element el-select通过ref获取value和label值
1.给el-select 加上ref
<el-select
ref="systemType"
v-model="selectValue"
filterable
clearable
placeholder="请选择系统类别"
>
2.methods方法中,通过this.$refs获取value和label值
let distributeSelectValue = this.$refs.systemType.selected.value;
let distributeSelectName = this.$refs.systemType.selected.label;
3.在methods的save方法中,打断点 debugger,然后npm run dev运行项目
打开对应界面,el-select选择器选择一个选项,点击f12,然后点保存按钮
点击f10一下一下到这两行代码中,看获得的值是否是选中的的value和label
let distributeSelectValue = this.$refs.systemType.selected.value;
let distributeSelectName = this.$refs.systemType.selected.label;