当前位置: 首页 > news >正文

佛山建网站公司哪家好做网站横幅用什么软件好

佛山建网站公司哪家好,做网站横幅用什么软件好,免费的开发网站建设,wordpress微博分享插件近期产品提出了一个需求#xff0c;要求一个form的表单里面的一个组件既可以下拉模糊搜索#xff0c;又可以弹窗搜索#xff0c;我就为这个封装了一个组件#xff0c;下面看效果图。 效果大家看到了#xff0c;下面就看组件封装和实现方法 第一步#xff0c;组件封装要求一个form的表单里面的一个组件既可以下拉模糊搜索又可以弹窗搜索我就为这个封装了一个组件下面看效果图。 效果大家看到了下面就看组件封装和实现方法 第一步组件封装我取名为C_SerachBtn 组件其中的C_Select组件也可以用el-select组件来代替C_Select使我们自己封装的组件。 templatediv classsearch-boxC_Selectv-bind$attrsv-model_modelValuefilterableremoteclearablereserve-keywordremote-show-suffix:remote-methodoverhaulProjectCodeMethod:options_options || []:loading_loadingfocusfocuschangehandleChangeSearchBtn($event)/el-button:iconSearchcolor#f5f7faclasssearch-box-btnclickhandleBtnClick//div /templatescript langts setup import { isFunction } from /utils/d_is import { Search } from element-plus/icons-vueinterface Props {value: anylabel?: anyoption?: anyoptions?: any[]// query代表的值queryValue: string// 列表label代表的字段labelField?: string// 列表label代表的字段valueField?: stringdisabledField?: string// 下拉数据请求接口api?: (arg?: any) Promiseany// 接口参数params?: any//返回的值和赋值的值callBackNames: any[],// 返回列表数据字段resultField?: string// 是否立即请求接口否则将在第一次获取焦点时触发请求immediate?: boolean// 是否多选multiple?: boolean }const props withDefaults(definePropsProps(), {labelField: label,valueField: value,disabledField: disabled,resultField: records,queryValue:,callBackNames:[],immediate: true, }) const emits defineEmits([update:value,update:label,update:option,change,visible-change,remove-tag,clear,blur,focus,// 下拉接口重新请求数据更新后触发options-change,//按钮点击btn-click, ]) const _selectRef ref() const _modelValue ref(props.value || ) const _options ref(props.options || []) const _option ref(props.option || {}) const _loading ref(false)watch(() props.options,(newVal) {if (props.api) return_options.value newVal},{deep: true,} )watch(() props.option,(newVal) {_option.value newVal},{deep: true,} )watch(() props.value,(newVal) {if (props.multiple !Array.isArray(newVal)) {console.error(multiple 为true时传入的value数据类型必须为array)}_modelValue.value newVal},{immediate: true,} )watch(() _modelValue.value,() {emits(update:value, _modelValue.value)},{immediate: true,} )//标准项目编号-搜索开始 const overhaulProjectCodeMethod async (query: string) {if (query) {const api props.apiif (!api || !isFunction(api)) return_options.value []_loading.value truelet obj {pageNum: 1,pageSize: 10,...props.params,}obj[props.queryValue] querylet res await api(obj)_loading.value falselet arr props.labelField.split(,)_options.value res.records.map((item) {let str arr.forEach(p str item[p] )return {label: str,value: item[props.valueField],name: item[props.valueField],key: item[props.valueField],...item,}})} else {_options.value []} }async function handleChangeSearchBtn(val) {if(!val){props.callBackNames.forEach(p{_option.value[p.value]   })return}let obj _options.value.filter((el) el.value val)[0]props.callBackNames.forEach(p{_option.value[p.value]   obj[p.name]})change(val) }//按钮点击 const handleBtnClick () {emits(btn-click, unref(_options)) }// 下拉接口重新请求数据更新后触发 const emitChange () {emits(options-change, unref(_options)) } // 当 input 获得焦点时触发 const focus (e) {emits(focus, e) } // 选中值发生变化时触发 const change (val) {let data _options.value?.filter((x) x.value val)emits(change, val, data) } // 下拉框出现/隐藏时触发 const visibleChange (val: boolean) {handleFetch()emits(visible-change, val) } // 多选模式下移除tag时触发 const removeTag (val) {emits(remove-tag, val) } // 可清空的单选模式下用户点击清空按钮时触发 const clear (e) {emits(clear, e) } // 当 input 失去焦点时触发 const blur (e) {emits(blur, e) } const getOptions () _options.value defineExpose({ selectMethods: _selectRef, getOptions }) /scriptstyle scoped .search-box{display: flex;width: 100%;.search-box-btn{border-top-left-radius: 0px;border-bottom-left-radius: 0px;border-top: 1px solid #dcdfe6;border-right: 1px solid #dcdfe6;border-bottom: 1px solid #dcdfe6;color: #a8abb2;} } /style 第二步页面使用在页面中el-table中当做slot使用我的slot取名为 overhaulProjectCode !-- 标准项目编号 --template #overhaulProjectCode{ row, index }C_SearchBtnv-model:valuerow.overhaulProjectCode:placeholder请选择:apiListOverhaulProject:optionrow:queryValueoverhaulCode:params{deviceCode: 0,status: 3,}:labelFieldoverhaulCode,overhaulName:valueFieldoverhaulCode:options[]:callBackNames[{name: id,value: overhaulProjectId,},{name: overhaulCode,value: overhaulProjectCode,},{name: overhaulName,value: overhaulProjectName,},]btn-clickhandleOverhaulCodeModalVisible(row, index)focushandleFocus(index)//template 第三步弹窗和一般的弹窗一样自行封装。 !-- 生产设备 --materialOnetitle选择生产设备v-ifmaterialOneModalVisible:datacurRowv-model:visiblematerialOneModalVisibleselecthandleMaterialOneSelect2closematerialOneModalVisible false/ 以上就是基本的做的c_SerachBtn的组件的封装其中的一些例如handleOverhaulCodeModalVisibl  和 handleFocus   方法需要自己定义根据自己的具体的需求进行修改。
http://www.hkea.cn/news/14439671/

相关文章:

  • so域名网站做网站要多少费用
  • 做企业网站需要自己有公司吗做网站的空间是什么
  • 福安市代理做网站前端学习手机网站开发吗
  • 企业注册网站wordpress 什么语言包
  • 张家港保税区规划建设局网站站长之家权重查询
  • 巩义企业网站建设百度搜图匹配相似图片
  • 网站建设的公司业务网站开发里程碑
  • 俄语网站叫什么yandex昆明二建建设集团网站
  • 江苏省建设工程竣工验收网站网站建设服务器是什么意思
  • 网站制作公司哪家好北京建设网证书查询平台官网
  • 怎么样优化网站seo制作装饰公司网站
  • 自己做电台直播的网站最大招聘网站
  • 免费1级做爰片在线观看 历史网站公司网站建设意见
  • 联想电脑网站建设策划书个人网站这么做
  • 设计师万能导航网站做网站全国最大
  • 网站开发李沛杰iis做网站上传速度慢
  • 加微信群网站怎么做的怎样做一元购网站
  • 360站长腾讯云轻量服务器
  • 做网站和app那个花销大上海企业一户式查询
  • 汕头网站设计浩森宇特360元网站建设 网络服务
  • 怎么做网站寄生虫软件培训公司排名
  • 网站建设的整个流程谷歌在线浏览器免费入口
  • 1997年做网站是什么语言对网站分析
  • 本地建站软件有哪些四平网站制作
  • 网站开发上传视频教程金坛市常州网络推广
  • 我做推广找不到我的网站建网站好还是开天猫好
  • 苍溪网站建设制作h5做网站用什么框架
  • 有没有那个网站是做点心的apache安装WordPress
  • 33岁改行做网站建设公司建立网站的必要性
  • 石家庄学做网站建设培训站长网站工具