uniapp 获取页面宽高,以及系统属性

uniapp

		onLoad() {
			let _this = this
			uni.getSystemInfo({
			    success: function (res) {
			        // console.log(res.windowWidth);
					_this.wdwidth = res.windowWidth+"px"
			        // console.log(res.windowHeight);
					_this.wdheight = res.windowHeight+"px"
			    }
			});
		},

在这里插入图片描述
在这里插入图片描述
文档说明

:style="{'height':wdheight}" 可以这样在vue 中进行样式绑定


版权声明:本文为weixin_45205118原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。