美文网首页
select change 拿到其他的值

select change 拿到其他的值

作者: 地主家也没余粮叻 | 来源:发表于2018-08-02 21:26 被阅读0次

<el-select clearable class="filter-item" v-model="productList.categoryId" @change="changeCategoryName"> <el-option v-for="item in categoryNameOption" :key="item.value" :label="item.label" :value="item.value"> {{item.label}}</el-option> </el-select>

data(){

return{
categoryNameOption:[

{label:'tome',value:1},

{label:'bob',value:2}
],
cateName:'',
}
},

methods:{
changeCategoryName (val){
let list= this. categoryNameOption.find(i =>i.value === val)
this. cateName = list.name
}}

相关文章

网友评论

      本文标题:select change 拿到其他的值

      本文链接:https://www.haomeiwen.com/subject/ssxevftx.html