29 lines
463 B
JavaScript
Raw Permalink Normal View History

2024-05-10 18:06:31 +08:00
const mixins = {
data() {
return {
2024-05-11 14:38:31 +08:00
wrapHeight: 'auto',
clientY: 0,
maxHeight: 0,
2024-05-10 18:06:31 +08:00
}
},
2024-05-11 16:55:28 +08:00
2024-05-11 14:38:31 +08:00
methods: {
// 移动
onTouchMove(e) {
2024-05-11 16:55:28 +08:00
console.log(e);
const moveDistance = e.changedTouches[0].clientY - this.clientY;
if (moveDistance > 5) {
this.wrapHeight = '352rpx';
} else {
this.wrapHeight = 0;
}
2024-05-11 14:38:31 +08:00
},
// 开始触摸屏幕
onTouchStart(e) {
2024-05-11 16:55:28 +08:00
this.clientY = e.changedTouches[0].clientY;
2024-05-11 14:38:31 +08:00
},
2024-05-10 18:06:31 +08:00
}
}
export default mixins;