云迈博客

您现在的位置是:首页 > 灌水专栏 > 正文

灌水专栏

element-ui 获取 table中选中的行的两种方式

zero2022-05-31灌水专栏298
Element获取table中选中的行的两种方式//methods添加方法selectionLineChangeHandle(val){this.

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);
       },

发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~