Element获取table中选中的行的两种方式

<el-table :data="data" style="width: 100%" border @selection-change="selectionLineChangeHandle" ref="multipleTable">
</el-table>
// methods 添加方法
       selectionLineChangeHandle (val) {
           this.dataonLineListSelections = val;
       },
       handleTime(type, title) {
       		// 方法一,通过selection-change 事件获取
           console.log(this.dataonLineListSelections);
           // 方法二,通过 this.$refs 获取
           console.log(this.$refs.multipleTable.selection);
       },
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐