Element-ui的表格单选
1.在data中定义
multipleSelection:[]
2. 当勾选操作时赋值
//表格发生勾选操作时赋值给multipleSelection字段
tableSelect(val){
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.multipleSelection = val.pop()
} else {
this.multipleSelection = val.pop()
}
}
3. 在事件里执行操作
if (this.multipleSelection) {
//逻辑正常操作
}