Vue获取屏幕高度

1.data中定义

curHeight:0,//当前所需屏幕高度

//获取屏幕高度

    beforeMount(height) {

        var h = document.documentElement.clientHeight || document.body.clientHeight;

        this.curHeight =h - height; //减去页面上固定高度height

    },



猜你喜欢

转载自blog.csdn.net/qq_23050099/article/details/80014400