Skip to content

Commit 168626b

Browse files
authored
feat(Image): Image support mouse wheel zoom in and out (#5703), close #5700
1 parent d930450 commit 168626b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/vc-image/src/Preview.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,14 @@ const Preview = defineComponent({
295295
},
296296
{ flush: 'post', immediate: true },
297297
);
298+
watch([lastWheelZoomDirection], () => {
299+
const { wheelDirection } = lastWheelZoomDirection.value;
300+
if (wheelDirection > 0) {
301+
onZoomOut();
302+
} else if (wheelDirection < 0) {
303+
onZoomIn();
304+
}
305+
});
298306
});
299307
onUnmounted(() => {
300308
removeListeners();

0 commit comments

Comments
 (0)