@yibozhang/pro-table 0.1.8 → 0.1.10

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.
@@ -3633,7 +3633,7 @@
3633
3633
  var actualSelect = element.querySelector('.ant-select');
3634
3634
  return actualSelect || element;
3635
3635
  }
3636
- // 获取原始的 nz-select 组件元素(用于读取 custom-width 属性)
3636
+ // 获取原始的 nz-select 组件元素(用于读取 custom-maxWidth 属性)
3637
3637
  function getOriginalSelectElement(element) {
3638
3638
  // 如果已经是 nz-select 组件标签,直接返回
3639
3639
  if (element.tagName === 'NZ-SELECT') {
@@ -3655,13 +3655,13 @@
3655
3655
  if (!actualSelect) {
3656
3656
  return;
3657
3657
  }
3658
- // 检查是否有自定义宽度属性
3658
+ // 检查是否有自定义最大宽度属性
3659
3659
  var originalSelect = getOriginalSelectElement(selectElement);
3660
3660
  if (originalSelect) {
3661
- var customWidth = originalSelect.getAttribute('custom-width');
3662
- if (customWidth) {
3663
- // 使用自定义宽度
3664
- actualSelect.style.width = customWidth;
3661
+ var customMaxWidth = originalSelect.getAttribute('custom-maxWidth');
3662
+ if (customMaxWidth) {
3663
+ // 使用自定义最大宽度
3664
+ actualSelect.style.maxWidth = customMaxWidth;
3665
3665
  return;
3666
3666
  }
3667
3667
  }
@@ -3672,7 +3672,7 @@
3672
3672
  if (parentWidth > 0) {
3673
3673
  // 设置宽度,可以减去一些 padding/margin 来避免溢出
3674
3674
  // 这里直接使用父元素宽度,如果需要可以调整
3675
- actualSelect.style.width = parentWidth + "px";
3675
+ actualSelect.style.maxWidth = parentWidth + "px";
3676
3676
  }
3677
3677
  }
3678
3678
  }