el官方对这个属性的介绍是,绝对值。无法使用百分比值,对做小组件不是很友好。
max-height | Table 的最大高度。 合法的值为数字或者单位为 px 的高度。 | string / number |
这里尝试曲线救国了,如下:
1.给自己组件设置个不会冲突的Id
2.js获取元素高度,动态设置表格高度tableHeight
var div = document.getElementById("给自己组件设置个不会冲突的Id"); console.log(div.offsetHeight) tableHeight.value = div.offsetHeight - 120;