فهرست منبع

表格多选bug修复

chenrui 3 سال پیش
والد
کامیت
32e1c4a12e
2فایلهای تغییر یافته به همراه3 افزوده شده و 7 حذف شده
  1. 1 1
      src/components/Table/index.js
  2. 2 6
      src/views/numsGoodsShelves/shelfMonitoring/list.vue

+ 1 - 1
src/components/Table/index.js

@@ -17,7 +17,7 @@ export default {
       type: [String, Function],
       default: 'key'
     },
-    rowKeyName: {
+    rowKeyName: { // 多选时,唯一标识键名
       type: String,
       default: 'id'
     },

+ 2 - 6
src/views/numsGoodsShelves/shelfMonitoring/list.vue

@@ -94,9 +94,10 @@
           ref="table"
           :style="{ height: tableHeight+84.5+'px' }"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.storeCallOutSn"
           :columns="columns"
           :data="loadData"
+          rowKeyName="storeCallOutSn"
           :rowSelection="{ columnWidth: 40 }"
           @rowSelection="rowSelectionFun"
           :scroll="{ y: tableHeight }"
@@ -172,11 +173,6 @@ export default {
       isSearch: false
     }
   },
-  computed: {
-    // hasSelected () {
-    //   return this.selectedRowKeys.length > 0
-    // },
-  },
   methods: {
     rowSelectionFun (obj) {
       console.log('rowSelection', obj)