Mini program uni-app page is highly adaptive (simple)

Mini program uni-app page is highly adaptive

There are many pitfalls in mini programs. It is better to use uni-app to write mini programs.
Insert image description here
Add a tag with an ID at the end of the page
Insert image description here
and then write this
Insert image description here
style in js to assign the value to the parent element. It will be ok.
Insert image description here

Attached:

onReady: function () {
    
    
		const query = uni.createSelectorQuery().in(this);
		query.select('#d').boundingClientRect(data => {
    
    
			this.home_page_height=data.top*2;
		}).exec();
    }

Guess you like

Origin blog.csdn.net/u010100877/article/details/112564563