|
|
@@ -3,6 +3,7 @@
|
|
|
<div class="table-container">
|
|
|
<h3 class="table-title">{{ title }}</h3>
|
|
|
<el-table
|
|
|
+ :key="tableKey"
|
|
|
:data="tableData"
|
|
|
border
|
|
|
stripe
|
|
|
@@ -110,9 +111,16 @@ export default {
|
|
|
default: '姓名/工号'
|
|
|
}
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableKey: 0 // 添加用于强制刷新的key
|
|
|
+ }
|
|
|
+ },
|
|
|
watch: {
|
|
|
tableData: {
|
|
|
handler(newVal) {
|
|
|
+ // 数据更新时增加key值强制刷新表格
|
|
|
+ this.tableKey++;
|
|
|
console.log('接收到的tableData:', newVal);
|
|
|
console.log('tableData长度:', newVal ? newVal.length : 0);
|
|
|
},
|