Files
vxe-table/examples/views/table/base/Selection.vue
xuliangzhan 956e08ae04 update
2019-05-17 22:32:55 +08:00

36 lines
1.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<p>多选表格勾选全部事件select-all勾选事件select-change</p>
<button class="btn" @click="$refs.xTable.toggleRowSelection(tableData[1])">切换第二行选中</button>
<button class="btn" @click="$refs.xTable.setSelection([tableData[2], tableData[3]], true)">设置第三四行选中</button>
<button class="btn" @click="$refs.xTable.setAllSelection(true)">设置所有行选中</button>
<button class="btn" @click="$refs.xTable.clearSelection()">清除所有行选中</button>
<vxe-table
ref="xTable"
border
height="300"
:data.sync="tableData">
<vxe-table-column type="selection" width="60"></vxe-table-column>
<vxe-table-column prop="name" label="Name"></vxe-table-column>
<vxe-table-column prop="sex" label="Sex"></vxe-table-column>
<vxe-table-column prop="age" label="Age"></vxe-table-column>
<vxe-table-column prop="address" label="Address" show-overflow></vxe-table-column>
</vxe-table>
</div>
</template>
<script>
export default {
data () {
return {
tableData: []
}
},
created () {
let list = window.MOCK_DATA_LIST.slice(0, 50)
this.tableData = list
}
}
</script>