iView如何获取表格中被选中行的值

刚接触不久,看官方教程上说通过触发事件 @on-current-change,可以自定义操作,事件返回两个值 currentRow 和 oldCurrentRow,分别为当前行的数据和上一次选择的数据。但是我并不知道该如何获取触发事件的返回值。

阅读 19.8k
3 个回答
html:
<Table highlight-row ref="currentRowTable" :columns="columns3" :data="data1" @on-current-change="handleRowChange"></Table>
//必须要有highlight-row,handleRowChange是自己定义的方法

methods:{
    handleRowChange(currentRow, oldCurrentRow){
        //console.log(currentRow)
        //console.log(oldCurrentRow)
    }
}
@on-current-change="handleChange"

methods: {
    handleChange(currentRow, oldCurrentRow) {
    
    }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题