1、表格多选时,处理完数据后会保留上一次选择的数据,再次处理时会带出上一次处理的数据,需要在第一次处理完数据后清空之前选择的内容(在处理完数据后,清空选择的数据)
<avue-crud ref="crud"></avue-crud>
this.$refs.crud.selectClear();
2、avue-crud参数:
<avue-crud
ref="crudTable"
:data="listData"
id="crudTable"
:option="option"
stripe
:page.sync="page"
@on-load="onPageLoad"
@sort-change="sortChange"
@current-row-change="handleCurrentRowChange"
@selection-change="selectionChange"
>
<template slot-scope="scope" slot="menu">
</template>
<template slot-scope="scope" slot="menuLeft">
</template>
</avue-crud>
@selection-change="selectionChange": 开启多选后的选中事件
option: {
selection: true, // 开起表格多选
columnBtn: false, // 隐藏表格右侧列显影按钮
refreshBtn: false, // 隐藏表格右侧刷新按钮
column: [
{
sortable: true,
label: "状态",
type: 'select',
props: {
label: 'F_ItemName',
value: 'F_ItemValue'
},
dicUrl: baseUrl + '/data-items/rptstatus/detail',
prop: "status",
},
]
}
3、表格加载默认全部选中
this.$nextTick(() => {
for (let i = 0; i < this.listData.length; i++) {
this.$refs.rfqvendorsignupTable.toggleRowSelection(this.listData[i],true);
}
});
3、表格中change等方法执行了多次(存在固定列,多一个固定列多执行一次)