iView的API文档真的不全
想要实现选中行高亮(不自动消失),关键就是下面2行代码
// 点击某一行时,自动选中该行
onRowClick (row, index) {
// toggleSelect 就是切换选中状态的方法,会触发 onSelect 与 onSelectCancel 事件
this.$refs.你的table组件的ref名称.toggleSelect(index)
},
onSelect (selection, row) {
// 高亮显示被选行,设置 _isHighlight
this.$refs.你的table组件的ref名称.objData[row.initRowIndex]._isHighlight = true
},