wdp-ambari前端组件样式封装点
# Table
动态计算高度满屏及分页
didInsertElement: function () {
this.handleWindowResize();
window.addEventListener('resize', this.handleWindowResize.bind(this))
},
handleWindowResize: function (params) {
const table = this.$('table tbody')
const bodyHeight = window.innerHeight;
if(table && table.length){
table[0].style.height = bodyHeight - 360 + 'px';
}
},
willDestroyElement: function() {
window.removeEventListener('resize', this.handleWindowResize.bind(this))
},
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
上次更新: 2023/11/17, 05:08:19