1.使用res <div class="cover" ref="div"></div> 2.使用this. r e f s [ ′ n a m e ′ ] 或 t h i s . refs['name'] 或 this. refs[′name′]或this.refs.name,即可获取dom节点 this.$refs['div'] 3.获取dom的位置 getBoundingClientRect()可以打印出dom 的位置宽高等信息 this.$refs['div'].getBoundingClientRect() 4.offsetHeight与offsetWidth可以单独获取w与h
