You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
element-bot
changed the title
[Bug Report] table组件height属性为字符串时无效
The height attribute of the [Bug Report] table component is invalid when it is a string
Jun 10, 2019
export 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;
}
table-layout.js line 56:
setHeight(value, prop = 'height') {
if (Vue.prototype.$isServer) return;
const el = this.table.$el;
value = parseHeight(value); // 100% turn into 100
this.height = value;
if (!el && (value || value === 0)) return Vue.nextTick(() => this.setHeight(value, prop));
if (value) {
el.style[prop] = `${value}px`; // style=height:100px
this.updateElsHeight();
}
}
Element UI version
2.9.1
OS/Browsers version
Google Chrome 74.0.3729.169
Vue version
2.6.10
Reproduction Link
https://codepen.io/luoshanmai/pen/orvpod?&editable=true
Steps to reproduce
设置属性height="100%"
What is Expected?
页面上显示为style="height:100%;"
What is actually happening?
页面上显示为style="height:100px;"
The text was updated successfully, but these errors were encountered: