vxe-table是一个基于Vue.js的表格组件,如果要获取checkbox选中行的下标,你可以使用vxe-table的selection属性。
在vxe-table中,selection属性是一个数组,其中包含了当前checkbox选中的行的信息。你可以使用selection属性来获取checkbox选中行的下标。
例如:
<template>
<vxe-table :data="tableData" :selection="selected" @select-change="handleSelectionChange">
<!-- table columns -->
</vxe-table>
</template>
<script>
export default {
data () {
return {
selected: [],
tableData: [
{ id: 1, name: 'a' },
{ id: 2, name: 'b' },
{ id: 3, name: 'c' }
]
}
},
methods: {
handleSelectionChange (selection) {
this.selected = selection
console.log(selection)
}
}
}
</script>