@lx-frontend/wrap-element-ui 1.0.25 → 1.0.26-beta.1

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": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.25",
3
+ "version": "1.0.26-beta.1",
4
4
  "description": "wrap-element-ui",
5
5
  "author": "",
6
6
  "main": "src/components/index.ts",
@@ -384,6 +384,8 @@ interface IProps {
384
384
  pagerCount?: number;
385
385
  /** 设置的迁移配置 */
386
386
  settingStorgeMigrationConfigs?: SettingStorgeMigrationConfigs
387
+ /** 自定义固定列,开启后 columnConfig 中的 fixed 属性优先级会大于 leftFixedCount */
388
+ customFixed?: boolean
387
389
  }
388
390
 
389
391
  interface IEmits {
@@ -440,6 +442,7 @@ const props = withDefaults(defineProps<IProps>(), {
440
442
  currentPage: 1,
441
443
  pageSizes: () => [10, 15, 30, 60, 100],
442
444
  pagerCount: 11,
445
+ customFixed: false,
443
446
  });
444
447
 
445
448
  // 同defineProps一样,不支持泛型参数从外部导入
@@ -466,13 +469,18 @@ const actualColumns = computed(() => {
466
469
  sortable: inSorting.value ? !!rawItem.sortable : false,
467
470
  _sortable: rawItem.sortable,
468
471
  };
469
- if (cnt > 0) {
470
- item.fixed = 'left';
471
- // eslint-disable-next-line no-plusplus
472
- cnt--;
473
- } else {
474
- item.fixed = undefined;
472
+
473
+ // 如果设置了 customFixed 属性,则不使用 leftFixedCount 来控制固定列,而是完全依赖 columnConfig 中的 fixed 属性
474
+ if (!props.customFixed) {
475
+ if (cnt > 0) {
476
+ item.fixed = 'left';
477
+ // eslint-disable-next-line no-plusplus
478
+ cnt--;
479
+ } else {
480
+ item.fixed = undefined;
481
+ }
475
482
  }
483
+
476
484
  res.push(item);
477
485
  }
478
486