<div class="award-list"
ref="awardlistbox"
@mousedown="startDrag"
@touchstart="startDrag"
@mousemove="onDrag"
@touchmove="onDrag"
@mouseup="endDrag"
@touchend="endDrag"
@wheel="onWheelScroll"
>
<div
class="award-list-item"
v-for="(item, index) in this.pushRecordsList"
:key="index">
........
</div>
</div>
------------------
data() {
return {
isDragging: false,
startY: 0,
scrollTop: 0,
};
},
methods: {
startDrag(event) {
this.isDragging = true;
this.startY = event.touches ? event.touches[0].clientY : event.clientY;
this.scrollTop = this.$refs
overflow:auto手机端无法滑动,在需要滑动的盒子上添加下面代码
于 2025-01-22 17:39:44 首次发布