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

[Bug Report] Table height changes to 100px (en: el-table forced the style height 100px) #16064

Closed
zyouzz opened this issue Jun 14, 2019 · 6 comments · Fixed by #16013
Closed

Comments

@zyouzz
Copy link

zyouzz commented Jun 14, 2019

Element UI version

0.1.0

OS/Browsers version

Google Chrome

Vue version

2.5.20

Reproduction Link

http://giser.tk/2019/06/14/38442.html

Steps to reproduce

之前使用2.8.1版本正常,更新版本2.9.1后,

What is Expected?

表格高度自适应

What is actually happening?

表格高度都强制设为100px

@element-bot element-bot changed the title [Bug Report] 表格高度都变为100px (en:el-table forced the style height 100px) [Bug Report] Table height changes to 100px (en: el-table forced the style height 100px) Jun 14, 2019
@element-bot
Copy link
Member

Translation of this issue:

Element UI version

0.1.0

OS/Browsers version

Google Chrome

Vue version

2.5.20

Reproduction Link

Https://codepen.io/pen

Steps to reproduce

Previous use of version 2.8.1 is normal, after updating version 2.9.1,

What is Expected?

Table Height Adaptation

What is actually happening?

Table height is mandatory at 100px

@zyouzz
Copy link
Author

zyouzz commented Jun 14, 2019

Reproduction Linkhttp://giser.tk/2019/06/14/38442.html

@libbGit
Copy link

libbGit commented Jun 17, 2019

我也遇到这个问题了,:height="100%" 时 默认会转化为100px

@Mutoumiao
Copy link

同样遇到该问题,并切换回 2.8.2版本,正常

@BurningBing
Copy link

我也遇到了这个问题,在源码table.js的418行,找到一个方法parseHeight,

function parseHeight(height) {
  if (typeof height === 'number') {
    return height;
  }
  if (typeof height === 'string') {
    if (/^\d+(?:px)?/.test(height)) {
      return parseInt(height, 10);
    }
    console.warn('[Element Warn][ElTable]invalid height and it will be ignored.');
  }
  return null;
}

不是很明白为什么要把所有传过来的height都转成int?

@ziyoung
Copy link
Contributor

ziyoung commented Jun 20, 2019

@BurningBing 提了一个 pr,修复了该问题,你可以 review 一下。

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

Successfully merging a pull request may close this issue.

6 participants