vue 获取dom元素的样式方法(height为列子)

//获取元素样式值,为元素ref="ele"(在样式里面写死了的高度)
var heightCss = window.getComputedStyle(this.$refs.ele).height; // ?px


//获取元素内联样式值
var heightStyle =this.$refs.ele.style.height; // ?px
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章