How to set element height dynamically by vue.js
This article introduces how to dynamically set the element height of vue.js, the content is very detailed, interested friends can refer to, hope to be helpful to you. Vue.js dynamically sets the height of the element: [data () {/ / store data}].
The operating environment of this paper: windows10 system, vue.js 2.9, thinkpad T480 computer.
If you don't say everything, go straight to the code:
Vue Code:
Data data:
Data () {/ / data return {divHeight:0, divWidth:0}} is stored here
Created method assignment
Created () {let divWidth = document.body.clientWidth+ "px"; let divHeight = document.body.clientHeight-130+ "px"; this.divWidth = divWidth this.divHeight = divHeight}, this is all about how to dynamically set the element height in vue.js. I hope the above can be helpful and learn more. If you think the article is good, you can share it for more people to see.