const mixins = { data() { return { wrapHeight: 'auto', clientY: 0, maxHeight: 0, } }, 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; // } } }, 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; }, } } export default mixins;