浏览代码

商城统计页面优化

xgb 1 月之前
父节点
当前提交
4fd93e07bc
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/views/hisStore/components/OrderSummaryTable.vue

+ 8 - 0
src/views/hisStore/components/OrderSummaryTable.vue

@@ -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);
       },