<div class="home-back" @click='backHome'>
<img :src="homeIcon">
</div>
dragIcon(){
let drag = document.querySelector('.home-back')
// let test = document.querySelector('.test')
let dragHeight = drag.clientHeight
let altitude = document.body.clientHeight - dragHeight
drag.addEventListener('touchmove',function(e){
var target = e.target
//阻止冒泡
e.stopPropagation()
//阻止浏览器默认的缩放和滚动
e.preventDefault()
if(e.targetTouches[0].clientY >= (dragHeight / 2) && e.targetTouches[0].clientY <= (altitude + (dragHeight / 2))){
drag.style.top = e.targetTouches[0].clientY - (dragHeight / 2) + 'px'
}
})
},
mounted(){
this.dragIcon();
},