init
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
})();
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user