VUE取得要素の高さ
483 ワード
テキストリンク:https://blog.csdn.net/zqian1994/article/details/82732825
Vueは要素の高さを取得する.
出力結果:100 100 px 100 px
Vueは要素の高さを取得する.
//
// ( +padding+ )
let height= this.$refs.elememt.offsetHeight;
// ( )
let height1 = window.getComputedStyle(this.$refs.element).height;
// ( )
let height2 = this.$refs.element.style.height;
console.info(height,height1,height2)
出力結果:100 100 px 100 px