The applet obtains the width, height and various information of the view node

var query = wx.createSelectorQuery();
//选择id
query.select('.demo').boundingClientRect(function (rect) {
	console.log(rect)
}).exec();

.demo is the css name of the element, pay attention to avoid duplication

Guess you like

Origin blog.csdn.net/jiaodeqiangs/article/details/95729229