Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

列表自适应出现省略号问题 #2694

Open
1 task done
chenxukf103 opened this issue Dec 18, 2024 · 0 comments
Open
1 task done

列表自适应出现省略号问题 #2694

chenxukf103 opened this issue Dec 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chenxukf103
Copy link

chenxukf103 commented Dec 18, 2024

可复现的链接(必须为公开链接,仅包含能复现问题的示例代码):

https://jsrun.net/TDtKp/edit

问题描述与截图:

设置列表自适应得时候,列得内容会出现省略号,需要点第二次查询才自适应,链接里面代码目前没有复现该问题,但是在项目得使用中经常发现该问题,对比了一下3.11.6(含)之前得代码和3.11.6之后得代码,发现table/src/methods.js里面得recalculate方法有不同。
3.11.6之前

recalculate(reFull) {
const $xeTable = this;
      const internalData = $xeTable;
      const {
        rceTimeout
      } = internalData;
      if (rceTimeout) {
        clearTimeout(rceTimeout);
      } else {
        handleRecalculateLayout($xeTable, !!reFull);
      }
    return new Promise(resolve => {
      internalData.rceTimeout = setTimeout(() => {
        internalData.rceTimeout = undefined;
        resolve(handleRecalculateLayout($xeTable, !!reFull));
      }, 20);
    });
  }

3.11.6之后

recalculate(reFull) {
    return new Promise(resolve => {
      const $xeTable = this;
      const internalData = $xeTable;
      const {
        rceTimeout
      } = internalData;
      if (rceTimeout) {
        clearTimeout(rceTimeout);
        $xeTable.$nextTick(() => {
          resolve();
        });
      } else {
        resolve(handleRecalculateLayout($xeTable, !!reFull));
      }
      internalData.rceTimeout = setTimeout(() => {
        internalData.rceTimeout = undefined;
        resolve(handleRecalculateLayout($xeTable, !!reFull));
      }, 20);
    });
  }

改动之后得autoCellWidth方法执行次数变少了,没有拿到最新得autList。
有遇到同样问题得大佬吗?解惑一下,是我新版用得方式不对吗?基本得配置参考链接

期望的结果:

列宽自适应列没有省略号

操作系统:

window10

浏览器版本:

chrome95

vue 版本:

vue 2.7

vxe-pc-ui 版本:

3.3.20

vxe-table 版本:

3.11.22

是否使用当前最新版本?

  • 我已确认是使用当前的最新版本并已按要求提供复现链接与示例代码。
@chenxukf103 chenxukf103 added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant