elementui学习笔记

获取el-select中的label值,参考el-select获取选中label值

在el-select中添加ref属性

在el-option中添加@click.native="labelClick(item.label)"

method方法接收

labelClick(res){

        this.category_show_1=this.$refs.selectLabel1.selectedLabel;

        this.category_show_2=this.$refs.selectLabel2.selectedLabel;

        this.category_show_3=this.$refs.selectLabel3.selectedLabel;

      },

selected点label一直显示undefined,所以用了selectedLabel

也可用

@click.native="labelClick(item.value)"

this.choiceprice_1=this.$refs.refpriceselect.selected.value;

猜你喜欢

转载自blog.csdn.net/weixin_42574985/article/details/127391269
今日推荐