vue element ui 表格的span-method方法合并单元格出现错位问题请教?
初进页面正常,删除或者新增数据时会频繁出现这种情况,刷新浏览器才能展示正常,有遇到过这种情况吗,怎么解决的
objectSpanMethod({ row, column, rowIndex, columnIndex }) {//将拆分开的数据合并 if ([0,1,2,3,4,5,6,7,13].includes(columnIndex)) {
const _row = this.rowspan[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
};
}
},
<custom-table :span-method="objectSpanMethod"
:columns="tableColumn"
:data="tableData"
:default-sort="{prop: 'ddcjsj', order: 'descending'}"
@selection-change="handleSelectChange"
ref='CustomTable'
:height='tableHeight'
></custom-table>
this.$axios({ method: "post",
url: "/order-api/commodity/infos/list",
data: invoiceData,
})
.then((response) => {
hideLoading();
let result = response.data;
console.log(result,'serult')
if (result.code == "0000") {
sessionStorage.setItem('setItem', JSON.stringify(result.data.list));
this.page.totalCount = result.data.totalCount;
this.convertTableData()//拿到接口返的数据根据明细拆成多条
this.beforeUpdate()//用的element ui 自带的doLayout()方法好像没生效
} else {
this.$message({
message: result.msg,
type: "error",
});
}
})
回答:
代码贴出来看看
回答:
删除或者新增后给表格加个动态key试试
以上是 vue element ui 表格的span-method方法合并单元格出现错位问题请教? 的全部内容, 来源链接: utcz.com/p/934099.html