new_shop_app/utils/mixin.js

39 lines
779 B
JavaScript
Raw 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 14:38:31 +08:00
watch: {
'where.cate_pid'(newVal, oldVal) {
// if (newVal && !oldVal) {
// this.wrapHeight = this.wrapHeight + 24;
// this.maxHeight = this.wrapHeight;
// }
// if (!newVal && oldVal) {
// this.wrapHeight = this.wrapHeight - 24;
// this.maxHeight = this.wrapHeight;
// }
2024-05-10 18:06:31 +08:00
}
2024-05-11 14:38:31 +08:00
},
methods: {
// 移动
onTouchMove(e) {
// const moveDistance = e.changedTouches[0].clientY - this.clientY;
// if (moveDistance > 5) {
// this.wrapHeight = this.maxHeight;
// } else {
// this.wrapHeight = 0;
// }
},
// 开始触摸屏幕
onTouchStart(e) {
// this.clientY = e.changedTouches[0].clientY;
},
2024-05-10 18:06:31 +08:00
}
}
export default mixins;