Browse Source

表格-记录保存用户修改的width

002390 1 year ago
parent
commit
4824dc258a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/components/super-ux-table/index.vue

+ 3 - 3
src/components/super-ux-table/index.vue

@@ -196,13 +196,12 @@ export default {
       }
     },
     // 宽度
-    onWidth(newProp, oldProp, column) {
-      console.log(column,'column');
+    onWidth({ column}) {
       this.innerColumns = this.innerColumns.map(({ item, attr }) => ({
         attr,
         item: {
           ...item,
-          width: item.key === column.property ? newProp : item.width,
+          width: item.key === column.property ? column.resizeWidth : item.width,
         },
       }));
       if (this.$props.storageKey) {
@@ -355,6 +354,7 @@ export default {
       :summary-method="getSummaries"
       highlight-current-row
       @row-click="onRowClick"
+      @header-dragend="onWidth"
       @selection-change="onSelectionChange"
       :header-row-style="{
         color: '#515a6e' ,