fix: totals
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
:navigation="true"
|
||||
:modules="modules"
|
||||
class="mySwiper w-full min-h-[200px]"
|
||||
@touchMove="onTouchMove"
|
||||
>
|
||||
<swiper-slide v-for="image in images">
|
||||
<img
|
||||
@@ -34,6 +35,7 @@ import 'swiper/css/pagination';
|
||||
|
||||
import {Pagination} from 'swiper/modules';
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Swiper,
|
||||
@@ -48,12 +50,37 @@ export default {
|
||||
},
|
||||
|
||||
setup() {
|
||||
const throttle = (func, delay) => {
|
||||
let lastCall = 0;
|
||||
return (...args) => {
|
||||
const now = Date.now();
|
||||
if (now - lastCall >= delay) {
|
||||
lastCall = now;
|
||||
func(...args);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const hapticTick = throttle(() => {
|
||||
const haptic = window?.Telegram?.WebApp?.HapticFeedback;
|
||||
if (haptic?.selectionChanged) {
|
||||
haptic.selectionChanged();
|
||||
} else if (haptic?.impactOccurred) {
|
||||
haptic.impactOccurred('light');
|
||||
}
|
||||
}, 100);
|
||||
|
||||
const onTouchMove = () => {
|
||||
hapticTick();
|
||||
};
|
||||
|
||||
return {
|
||||
pagination: {
|
||||
clickable: true,
|
||||
dynamicBullets: true,
|
||||
},
|
||||
modules: [Pagination],
|
||||
onTouchMove, // ← вот это добавь
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user