VUE.JS
# 窗口发生变化时,获取当前窗口的高度。
mounted () {
const that = this;
window.onresize = () => {
return (() => { that.screenHeight = window.innerHeight })() } }, data(){ return { screenHeight: window.innerHeight, } }
VUE.JS
# 窗口发生变化时,获取当前窗口的高度。
mounted () {
const that = this;
window.onresize = () => {
return (() => { that.screenHeight = window.innerHeight })() } }, data(){ return { screenHeight: window.innerHeight, } }