export default {
name: 'page-index',
data(){
return{
windowWidth: document.documentElement.clientWidth,
windowHeight: document.documentElement.clientHeight,
}
},
methods: {
},
watch: {
windowHeight (val) {
let that = this;
console.log("实时屏幕高度:",val, that.windowHeight );
},
windowWidth (val) {
let that = this;
console.log("实时屏幕宽度:",val, that.windowHeight );
}
},
mounted() {
var that = this;
window.onresize = () => {
return (() => {
window.fullHeight = document.documentElement.clientHeight;
window.fullWidth = document.documentElement.clientWidth;
that.windowHeight = window.fullHeight;
that.windowWidth = window.fullWidth;
})()
};
},
}