Element獲取table中選中的行
實驗版本為:Element2.13.1
‘’this.$refs.multipleTable.selection‘獲取表格選中行資訊 :
<el-button type="primary" @click="getSelection">獲取</el-button>
<el-table :data="tableData" ref="multipleTable" border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="date" label="日期" width="180"></el-table-column>
<el-table-column prop="name" label="姓名" width="180"></el-table-column>
<el-table-column prop="address" label="地址" width="300"></el-table-column>
</el-table>
methods: {
getSelection() {
const _selectData = this.$refs.multipleTable.selection;
console.log(_selectData);
}
}
————————————————
版權宣告:本文為CSDN博主「duansamve」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/duansamve/article/details/105900195