JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.4.11/lib/index.js"></script>
<div id="app">
<h1>
Table 1
</h1>
<el-table
ref="multipleTable1"
:data="tableData1">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="Date"
width="120">
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column>
<el-table-column
property="name"
label="Name"
width="120">
</el-table-column>
<el-table-column
property="address"
label="Address"
show-overflow-tooltip>
</el-table-column>
</el-table>
<h1>
Table 2
</h1>
<el-table
ref="multipleTable2"
:data="tableData2">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="Date"
width="120">
<template slot-scope="scope">{{ scope.row.date }}</template>
</el-table-column>
<el-table-column
property="name"
label="Name"
width="120">
</el-table-column>
<el-table-column
property="address"
label="Address"
show-overflow-tooltip>
</el-table-column>
</el-table>
</div>
SCSS
@import url("//unpkg.com/element-ui@2.4.11/lib/theme-chalk/index.css");
Babel + JSX
var Main = {
data() {
return {
tableData1: [{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles'
}, {
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles'
}, {
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles'
}],
tableData2: [{
date: '2016-05-03',
name: 'Tom 2',
address: 'No. 189, Grove St, Los Angeles'
}, {
date: '2016-05-02',
name: 'Tom 2',
address: 'No. 189, Grove St, Los Angeles'
}, {
date: '2016-05-04',
name: 'Tom 2',
address: 'No. 189, Grove St, Los Angeles'
}],
multipleSelection: []
}
},
mounted () {
// Only the last one works
this.$refs.multipleTable1.toggleAllSelection()
this.$refs.multipleTable2.toggleAllSelection()
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')