fix: 修复移动端文件列表滑动问题
- 移除 touchstart 中的 event.preventDefault(),不再阻止默认滚动 - 添加 handleLongPressMove 方法检测手指移动 - 滑动超过 10px 时自动取消长按,允许正常滚动 - 为 grid 和 list 视图的文件项添加 @touchmove 事件 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1216,7 +1216,7 @@
|
||||
|
||||
<!-- 大图标视图 -->
|
||||
<div v-else-if="fileViewMode === 'grid'" class="file-grid">
|
||||
<div v-for="file in files" :key="file.name" class="file-grid-item" @click="handleFileClick(file)" @contextmenu.prevent="showFileContextMenu(file, $event)" @touchstart="handleLongPressStart(file, $event)" @touchend="handleLongPressEnd">
|
||||
<div v-for="file in files" :key="file.name" class="file-grid-item" @click="handleFileClick(file)" @contextmenu.prevent="showFileContextMenu(file, $event)" @touchstart="handleLongPressStart(file, $event)" @touchmove="handleLongPressMove($event)" @touchend="handleLongPressEnd">
|
||||
<div class="file-icon">
|
||||
<!-- 图片缩略图 -->
|
||||
<img v-if="file.name.match(/\.(jpg|jpeg|png|gif|bmp|svg|webp)$/i) && getThumbnailUrl(file)"
|
||||
@@ -1254,11 +1254,12 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="file in files" :key="file.name"
|
||||
<tr v-for="file in files" :key="file.name"
|
||||
style="border-bottom: 1px solid #eee; cursor: pointer;"
|
||||
@click="handleFileClick(file)"
|
||||
@contextmenu.prevent="showFileContextMenu(file, $event)"
|
||||
@touchstart="handleLongPressStart(file, $event)"
|
||||
@touchmove="handleLongPressMove($event)"
|
||||
@touchend="handleLongPressEnd"
|
||||
@mouseover="$event.currentTarget.style.background='#f9f9f9'"
|
||||
@mouseout="$event.currentTarget.style.background='white'">
|
||||
|
||||
Reference in New Issue
Block a user