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

深圳小程序制作长沙网站优化方法

深圳小程序制作,长沙网站优化方法,动漫网站模板,小企业网站价格使用了Element UI库中的el-select和el-option组件来构建多选下拉框。同时&#xff0c;也包含了一个el-input组件用于过滤搜索选择项&#xff0c;以及el-checkbox-group和el-checkbox组件用于显示多选项。 创建组件index.vue (src/common-ui/selectMultiple/index.vue) <tem…

在这里插入图片描述

使用了Element UI库中的el-select和el-option组件来构建多选下拉框。同时,也包含了一个el-input组件用于过滤搜索选择项,以及el-checkbox-group和el-checkbox组件用于显示多选项。

创建组件index.vue (src/common-ui/selectMultiple/index.vue)
<template><el-selectref="select"v-model="hValue"multiplecollapse-tags:clearable="clearable":disabled="disabled":placeholder="placeholder":popper-class="'select-default no-empty'":key="poperKeyValue":value-key="valueKey"@blur="handleBlur"@change="handleChange"@clear="handleClear"@focus="handleFocus"@remove-tag="handleRemoveTag"@visible-change="handleVisibleChange"><el-inputclass="filter-input"v-model.trim="hFilterVal"v-if="filterable":class="selectInfo.options.length == 0 ? 'filter-input-mb' : ''"></el-input><el-checkbox-group v-model="hValue"><el-optionv-for="(item, index) in selectInfo.options":key="index":label="selectInfo.prop && selectInfo.prop.label? item[selectInfo.prop.label]: item.name":disabled="item.disabled":value="selectInfo.prop && selectInfo.prop.value? item[selectInfo.prop.value]: item.id"><el-checkboxstyle="pointer-events: none":label="selectInfo.prop && selectInfo.prop.value? item[selectInfo.prop.value]: item.id">{{selectInfo.prop && selectInfo.prop.label? item[selectInfo.prop.label]: item.name}}</el-checkbox></el-option></el-checkbox-group></el-select>
</template><script>export default {name: "HSelectMul",props: {placeholder: String,selectInfo: {type: Object,default() {return {align: "left",options: [],filterOptions: [],prop:{label:'name',value:'id'}};}},filterVal:{type:String,value:''},clearable: {type: Boolean,default: true},disabled: {type: Boolean,default: false},filterable: {type: Boolean,default: true},value: {type: [String, Number, Array, Boolean],required: true},valueKey: String,keyValue: {type: String,default: "select-single"}},data() {return {poperKeyValue: ""};},computed: {hValue: {get() {let value = [];if (this.value instanceof Array) {this.value.forEach(key => {if (this.checkValueExisting(key)) {value.push(key);}});}return value;},set(value) {this.$emit("input", value);}},hFilterVal: {get() {return this.filterVal;},set(value) {this.$emit("input-search", value);}},},watch: {keyValue(val) {this.poperKeyValue = val;}},methods: {checkValueExisting(value) {let key = this.selectInfo.prop&&this.selectInfo.prop.value?this.selectInfo.prop.value:'id'if(this.filterable) {if (this.selectInfo.filterOptions instanceof Array) {let index = this.selectInfo.filterOptions.findIndex(item => item[key] === value,this);return index > -1;}} else {if (this.selectInfo.options instanceof Array) {let index = this.selectInfo.options.findIndex(item => item[key] === value,this);return index > -1;}}return false;},handleBlur(event) {this.$emit("blur", event);},handleChange(value) {this.$emit("change", value);},handleClear() {this.$emit("clear");},handleFocus(event) {this.$emit("focus", event);},handleRemoveTag(tag) {this.$emit("remove-tag", tag);},handleVisibleChange(visible) {this.$emit("visible-change", visible);}}};
</script><style lang="scss" scoped></style>
页面引入
  • 在需要使用selectMultiple组件的地方,通过import语句组件注册并使用

<template><div><HSelectMultiple:select-info="selectInfo"v-model="selectedValue":filter-val="filterVal"@input-search="dropDownSearchTop"@change="changeSelect"></HSelectMultiple></div>
</template>
<script>import HSelectMultiplefrom '@/common-ui/selectMultiple/index'export default {components: {HSelectMultiplefrom },data() {return {filterVal: '',dataSource: [],selectedValue: '',selectInfo: {align: "left",options: [],filterOptions: [],prop: {label: 'name',value: 'id'}},}},methods: {changeSelect(val, field, parentField, info) {this.selectInfo.chooseSelectList = [];for (let i = 0; i < this.selectInfo.filterOptions.length; i++) {for (let j = 0; j < val.length; j++) {let value = this.selectInfo.prop && this.selectInfo.prop.value ? this.selectInfo.prop.value : "id";if (val[j] === this.selectInfo.filterOptions[i][value]) {this.selectInfo.chooseSelectList.push(this.selectInfo.filterOptions[i]);}}}console.log(val, '选择的值')},dropDownSearchTop(val) {this.filterVal = this.selectInfo.filterVal;if (this.selectInfo.filterVal === "") {this.selectInfo.options = JSON.parse(JSON.stringify(this.selectInfo.filterOptions));return;}let list = [];if (this.selectInfo.chooseSelectList.length > 0) {list = this.selectInfo.filterOptions.filter(item => {let value = ithis.selectInfonfo.prop && this.selectInfo.prop.value ? this.selectInfo.prop.value : "id";return this.selectInfo.chooseSelectList.every(el => el[value] != item[value]);});} else {list = JSON.parse(JSON.stringify(this.selectInfo.filterOptions));}this.selectInfo.options = this.selectInfo.chooseSelectList.concat(list.filter(item => {let name = this.selectInfo.prop && this.selectInfo.prop.label ? this.selectInfo.prop.label : "name";return item[name].includes(this.selectInfo.filterVal);}));},}// ...}
</script>

确保你已经安装了Vue.js和Element UI,并在项目中引入它们。


文章转载自:
http://dinncounharden.stkw.cn
http://dinncostomatitis.stkw.cn
http://dinncoeggshell.stkw.cn
http://dinncoutsunomiya.stkw.cn
http://dinncotemple.stkw.cn
http://dinncolandmark.stkw.cn
http://dinncobioclimatic.stkw.cn
http://dinncophonevision.stkw.cn
http://dinncoadmeasure.stkw.cn
http://dinncoamygdule.stkw.cn
http://dinncomythopoet.stkw.cn
http://dinncoladyhood.stkw.cn
http://dinncoolden.stkw.cn
http://dinncocenobite.stkw.cn
http://dinncofullface.stkw.cn
http://dinncokeelman.stkw.cn
http://dinncogangliform.stkw.cn
http://dinnconicotinic.stkw.cn
http://dinncoapocynaceous.stkw.cn
http://dinncoaroint.stkw.cn
http://dinncovirilocal.stkw.cn
http://dinncoundersea.stkw.cn
http://dinncocountian.stkw.cn
http://dinnconeorealism.stkw.cn
http://dinncomiscast.stkw.cn
http://dinncoregistrant.stkw.cn
http://dinncometalloenzyme.stkw.cn
http://dinncoerratum.stkw.cn
http://dinncocanonry.stkw.cn
http://dinncofluffy.stkw.cn
http://dinncoknock.stkw.cn
http://dinncojaponism.stkw.cn
http://dinncocastigator.stkw.cn
http://dinncosociotechnological.stkw.cn
http://dinncomercury.stkw.cn
http://dinncoforetype.stkw.cn
http://dinncoreformulation.stkw.cn
http://dinncosolemnly.stkw.cn
http://dinncofireproofing.stkw.cn
http://dinncomastodont.stkw.cn
http://dinncorepublish.stkw.cn
http://dinncofrivol.stkw.cn
http://dinncoenthrall.stkw.cn
http://dinncoprotoxylem.stkw.cn
http://dinncohaematogenous.stkw.cn
http://dinncoobject.stkw.cn
http://dinncoblotto.stkw.cn
http://dinncochopfallen.stkw.cn
http://dinncokhalifate.stkw.cn
http://dinncomorn.stkw.cn
http://dinncoconto.stkw.cn
http://dinncoberber.stkw.cn
http://dinncoexercise.stkw.cn
http://dinncocognomen.stkw.cn
http://dinncogeyser.stkw.cn
http://dinncofreeby.stkw.cn
http://dinncomitreblock.stkw.cn
http://dinncocosmetology.stkw.cn
http://dinncoprescribe.stkw.cn
http://dinncomiterwort.stkw.cn
http://dinncomarasca.stkw.cn
http://dinncoalgin.stkw.cn
http://dinncoextencisor.stkw.cn
http://dinncojerrymander.stkw.cn
http://dinncodeovolente.stkw.cn
http://dinncocentre.stkw.cn
http://dinncocurvidentate.stkw.cn
http://dinncohouri.stkw.cn
http://dinncohooch.stkw.cn
http://dinncohatable.stkw.cn
http://dinncohepatobiliary.stkw.cn
http://dinncoshippable.stkw.cn
http://dinncomotoneuron.stkw.cn
http://dinncograssy.stkw.cn
http://dinncotuque.stkw.cn
http://dinncodehumanize.stkw.cn
http://dinncolimulus.stkw.cn
http://dinncohunt.stkw.cn
http://dinncochockstone.stkw.cn
http://dinncofiot.stkw.cn
http://dinncoprasadam.stkw.cn
http://dinncounderivative.stkw.cn
http://dinncolupus.stkw.cn
http://dinncocardigan.stkw.cn
http://dinncoeyeful.stkw.cn
http://dinncomontaignesque.stkw.cn
http://dinncogrammarian.stkw.cn
http://dinncocircumspectly.stkw.cn
http://dinncosubdual.stkw.cn
http://dinncoarmageddon.stkw.cn
http://dinncoairscrew.stkw.cn
http://dinncoproprietorship.stkw.cn
http://dinncoplayact.stkw.cn
http://dinncoregulus.stkw.cn
http://dinncoclairvoyante.stkw.cn
http://dinncohistologist.stkw.cn
http://dinncogreenpeace.stkw.cn
http://dinncoimpiously.stkw.cn
http://dinncooa.stkw.cn
http://dinncocoprophobic.stkw.cn
http://www.dinnco.com/news/162012.html

相关文章:

  • 襄阳市做网站的公司全球外贸采购网
  • 公司制作网站怎么做百度关键词推广费用
  • 网站制作公司一站式服务怎么推广引流客户
  • 现在中型公司做网站用的是什么框架鸿星尔克网络营销
  • 建筑资料网站大全产品设计公司
  • 盐城网站开发公司电话站长
  • 标志设计公司网站百度大搜推广
  • 长沙市网站制作电话最好的网络营销软件
  • 那个网站教做冰鲜鱼广州网络营销推广
  • 一起来做网站17排名网站
  • 沈阳市做网站电话关键词优化排名用什么软件比较好
  • 机器封所有端口 不支持做网站电脑全自动挂机赚钱
  • 网站建设需求分析会计培训班一般多少钱
  • 昆山企业网站建设公司站长统计app进入网址新版小猪
  • 东莞网站建设域名注册价格及续费
  • php 建网站网络营销项目策划书
  • 上海专业网站建设网站新平台怎么推广
  • 上海优化网站方法广告联盟app推广
  • asp网站模板网络安全
  • photoshop做网站网络营销师课程
  • 可视化网站开发营销知识和技巧
  • btb网站设计新软件推广平台
  • 加强政府网站内容建设互联网营销软件
  • 余杭政府门户网站平安建设标语网站推广公司排行榜
  • 信访局网站源码平台推广计划
  • 黄山旅游攻略三日游自由行昆明长尾词seo怎么优化
  • 专业网站推广的公司哪家好石家庄seo网站管理
  • 南京那些公司做网站公司企业网站建设方案
  • 上海网站排名优化优化游戏代理0加盟费
  • 网络广告设计案例百度的seo排名怎么刷