n20-common-lib 2.10.19 → 2.10.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.10.19",
3
+ "version": "2.10.20",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -61,7 +61,7 @@
61
61
  :field="item.prop"
62
62
  >
63
63
  <template slot-scope="scope">
64
- <renderer :renderContent="item.render" :scope="scope"></renderer>
64
+ <renderer :render-content="item.render" :scope="scope" />
65
65
  </template>
66
66
  </vxe-column>
67
67
  <vxe-column
@@ -216,6 +216,11 @@ export default {
216
216
  key: 0
217
217
  }
218
218
  },
219
+ computed: {
220
+ _columns() {
221
+ return this.calcColumnWidth(this.columns)
222
+ }
223
+ },
219
224
  watch: {
220
225
  columns() {
221
226
  this.colsKey = this.colsKey + 1
@@ -231,11 +236,6 @@ export default {
231
236
  }
232
237
  }
233
238
  },
234
- computed: {
235
- _columns() {
236
- return this.calcColumnWidth(this.columns)
237
- }
238
- },
239
239
  activated() {
240
240
  this.$refs.vxeTable.loadData(this.data)
241
241
  },
@@ -336,9 +336,7 @@ export default {
336
336
  calcColumnWidth(columns) {
337
337
  columns = XEUtils.clone(columns, true)
338
338
  const wrapperEl = document.querySelector('div#app')
339
- const notHasWidth = columns.filter(
340
- (column) => !column.width && !column.minWidth && column.label !== $lc('操作')
341
- )
339
+ const notHasWidth = columns.filter((column) => !column.width && !column.minWidth && column.label !== $lc('操作'))
342
340
  if (!wrapperEl || notHasWidth.length > 0) {
343
341
  return columns
344
342
  }
@@ -349,7 +347,7 @@ export default {
349
347
  if (column.static && column.label === $lc('操作') && !column.width && !column.minWidth) {
350
348
  column.width = 80
351
349
  }
352
- if (column.type) {
350
+ if (column.type === 'checkbox') {
353
351
  column.width = 80
354
352
  }
355
353
  const width = column.minWidth || column.width
@@ -358,6 +356,7 @@ export default {
358
356
  column['minWidth'] = undefined
359
357
  columnsWidth += column.width
360
358
  })
359
+
361
360
  if (columnsWidth >= windowWidth) return columns
362
361
  return columns.map((column) => {
363
362
  if (!column.type) {
@@ -365,9 +364,11 @@ export default {
365
364
  column['width'] = windowWidth * rate
366
365
  return column
367
366
  }
367
+
368
368
  return column
369
369
  })
370
370
  }
371
+
371
372
  return calc(columns)
372
373
  }
373
374
  }