vue可以通过ref去获取这个dom <div class="dragbox" ref="dragbox"></div> this.dragWidth=this.$refs.dragbox.offsetWidth;//获取这个div的宽度