<Table ref="selection" :columns="tableColumns" :data="tableData" size="small"></Table>
computed: {
tableColumns () {
let columns = [];
if (this.showCheckbox) {
columns.push({
type: 'selection',
width: 60,
align: 'center'
})
}
if (this.showIndex) {
columns.push({ type: 'index', width: 60, align: 'center'
})
}
columns.push({ title: 'Date', key: 'date', sortable: true });
columns.push({ title: 'Name', key: 'name' });
columns.push({ title: 'Address', key: 'address', key: 'address' });
return columns;
}
}
比如我要把最后一列上移到第一位,或者把第二列移动到第三列,每个列可以手动排序