n20-common-lib 2.20.2 → 2.20.3

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.20.2",
3
+ "version": "2.20.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -368,9 +368,9 @@ export default {
368
368
  column.minWidth = Math.ceil(textLength * CHAR_WIDTH + PADDING)
369
369
  }
370
370
 
371
- const width = column.minWidth || column.width
371
+ // 优先使用width,如果width不存在才使用minWidth
372
+ const width = column.width || column.minWidth
372
373
  column['_width_'] = column['_width_'] || parseInt(width)
373
- /* column['width'] = parseInt(width) */
374
374
  columnsWidth += column['_width_']
375
375
  })
376
376
 
@@ -383,7 +383,10 @@ export default {
383
383
  return columns.map((column) => {
384
384
  if (!column.type) {
385
385
  const rate = column['_width_'] / columnsWidth
386
- column['width'] = Math.max(windowWidth * rate, column.minWidth || column.width)
386
+ // 如果columnwidth,则保持原width不变;如果没有width,则计算新宽度但不小于minWidth
387
+ if (!column.width) {
388
+ column['width'] = Math.max(windowWidth * rate, column.minWidth)
389
+ }
387
390
  return column
388
391
  }
389
392
  return column