鍍金池/ 問答/Linux  HTML/ iView如何獲取表格中被選中行的值

iView如何獲取表格中被選中行的值

剛接觸不久,看官方教程上說通過觸發(fā)事件 @on-current-change,可以自定義操作,事件返回兩個值 currentRow 和 oldCurrentRow,分別為當前行的數(shù)據(jù)和上一次選擇的數(shù)據(jù)。但是我并不知道該如何獲取觸發(fā)事件的返回值。

回答
編輯回答
醉淸風
@on-current-change="handleChange"

methods: {
    handleChange(currentRow, oldCurrentRow) {
    
    }
}
2017年8月14日 13:16
編輯回答
疚幼
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)
    }
}
2018年9月15日 07:39
編輯回答
有點壞
2018年3月13日 16:38