diff --git a/src/utils/tableHeight.js b/src/utils/tableHeight.js index 8a8a938..3c841f1 100644 --- a/src/utils/tableHeight.js +++ b/src/utils/tableHeight.js @@ -3,9 +3,9 @@ export function calculationTableHeight(ref, plusHeight) { return ref.offsetHeight - plusHeight || 0; }; // 保存列宽 -export function saveRowWidth({property}, width) { +export function saveRowWidth({ rawColumnKey }, width) { let allRowWidth = localStorage.allRowWidth ? JSON.parse(localStorage.allRowWidth) : {}; - allRowWidth[property] = width; + allRowWidth[rawColumnKey] = width; localStorage.allRowWidth = JSON.stringify(allRowWidth); } // 获取列表 diff --git a/src/views/factoryModel/basicUnit/index.vue b/src/views/factoryModel/basicUnit/index.vue index c344209..f4096ec 100644 --- a/src/views/factoryModel/basicUnit/index.vue +++ b/src/views/factoryModel/basicUnit/index.vue @@ -45,12 +45,15 @@ border v-if="tableHeight" :height="tableHeight" + @header-dragend="(newWidth, oldWidth, column)=>saveRowWidth(column, newWidth)" >