Skip to content

Commit

Permalink
fix: 不禁止默认事件
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwei committed May 17, 2024
1 parent 77476e2 commit 7cc10e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/client/views/bing/components/FullpageScroll/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const handleMouseWheel = (e) => {
} else if (e.wheelDelta > 30 && !inMove.value) {
moveDown();
}
e.preventDefault();
// e.preventDefault();
return false;
};
Expand Down Expand Up @@ -84,12 +84,12 @@ const handleMouseWheelDOM = (e) => {
const touchStartY = ref(0);
const touchStart = (e) => {
e.preventDefault();
// e.preventDefault();
touchStartY.value = e.touches[0].clientY;
};
const touchMove = (e) => {
if (inMove.value) return false;
e.preventDefault();
// e.preventDefault();
const currentY = e.touches[0].clientY;
Expand All @@ -105,10 +105,10 @@ const touchMove = (e) => {
onMounted(() => {
calculateSectionOffsets();
window.addEventListener("mousewheel", handleMouseWheel, { passive: false });
window.addEventListener("mousewheel", handleMouseWheel, { passive: true });
window.addEventListener("DOMMouseScroll", handleMouseWheelDOM); // Mozilla Firefox
window.addEventListener("touchstart", touchStart, { passive: false }); // mobile devices
window.addEventListener("touchmove", touchMove, { passive: false }); // mobile devices
window.addEventListener("touchstart", touchStart, { passive: true }); // mobile devices
window.addEventListener("touchmove", touchMove, { passive: true }); // mobile devices
});
onUnmounted(() => {
Expand Down

0 comments on commit 7cc10e5

Please sign in to comment.