Files
2026-08-12 17:19:37 +08:00

35 lines
1016 B
JavaScript

export const self_viewport = {
data() {
return {
height: null
};
},
computed: {
useTableHeight() {
return (settings = {}) => {
let { isSearch = true, isPage = true, otherH = 0 } = settings;
let bodyH = this.height,
headerH = 100,
paddingH = 15,
searchH = 62 + 10,
pageH = 62,
borderH = 4;
let tableH = bodyH - headerH - paddingH - borderH;
isSearch && (tableH -= searchH);
isPage && (tableH -= pageH);
otherH > 0 && (tableH -= otherH);
console.log(tableH);
return tableH;
};
}
},
mounted() {
this.height = document.body.clientHeight;
window.onresize = () => {
return (() => {
this.height = document.body.clientHeight;
})();
};
}
};