element-ui官網的table組件中提到:element-ui
經過
Scoped slot
能夠獲取到 row, column, $index 和 store(table 內部的狀態管理)的數據。ui
使用:spa
<el-table-column prop="金額" label="金額(萬)" min-width="120" align="center" > <template slot-scope="scope" > <p @click="function1(scope.row.data1,'參數')">
{{scope.row['金額']|toFixedNum(param)|numFormat(param)}}
</p>
</template>
</el-table-column>
如上述代碼,能夠在<template scope="scope">中經過scope.row.鍵名,獲取所在行的某一列的數據。同時能夠添加點擊事件,也能夠使用過濾器;.net
emm......關於<template scope="scope">的理解,原本想多寫點,一直很忙沒時間,等後來有空了,想一想下方連接的做者寫的不錯,那就直接貼上這個連接吧:code