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

When [Bug Report] el-table is used in conjunction with keep-alive, when the component is reactivated, the column height using fixed is 17 PX less. #16525

Closed
HuangZhaoPing opened this issue Jul 11, 2019 · 3 comments · May be fixed by #22886
Assignees
Labels

Comments

@HuangZhaoPing
Copy link

Element UI version

2.10.1

OS/Browsers version

win10 / chrome 75.0.3770.100

Vue version

2.6.10

Reproduction Link

https://codepen.io/anon/pen/ZdPxEM

Steps to reproduce

抱歉用中文,怕用英文描述不清楚

重现步骤:

1、el-table与keep-alive配合使用

2、设置列的fixed为left或者right

3、表格不能出现横向滚动条

4、点击switch两次,重新激活组件

5、fixed列的高度少了17px(滚动条的原因?)

What is Expected?

高度正确

What is actually happening?

高度少了17px

@element-bot element-bot changed the title [Bug Report] el-table与keep-alive配合使用时,当组件重新激活后,使用了fixed的列高度少了17px When [Bug Report] el-table is used in conjunction with keep-alive, when the component is reactivated, the column height using fixed is 17 PX less. Jul 11, 2019
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

2.10.1

OS/Browsers version

Win10 / Chrome 75.0.3770.100

Vue version

2.6.10

Reproduction Link

Https://codepen.io/anon/pen/ZdPxEM

Steps to reproduce

I'm sorry to use Chinese, but I'm afraid I can't describe it clearly in English.

Reproduction steps:

  1. The use of el-table and keep-alive

  2. Set the fixed column to left or right

  3. No horizontal scrollbars are allowed in tables

  4. Click switch twice to reactivate the component

  5. The height of the fixed column is 17 PX less.

What is Expected?

Highly correct

What is actually happening?

Height is 17 PX less

@stale
Copy link

stale bot commented Jul 30, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 30, 2020
@stale stale bot closed this as completed Aug 8, 2020
@a1mersnow
Copy link

a1mersnow commented May 27, 2024

You can patch the element-ui.common.js in node_modules/element-ui/lib like this:

From:

doLayout: function doLayout() {
  if (this.shouldUpdateHeight) {
    this.layout.updateElsHeight();
  }
  this.layout.updateColumnsWidth();
},

To:

doLayout: function doLayout() {
  this.layout.updateColumnsWidth();
  if (this.shouldUpdateHeight) {
    this.layout.updateElsHeight();
  }
},

Don't know how reliable this method is. I just tested some cases and found it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants