|
|
@ -43,7 +43,7 @@ import ShopItem from '@/base/ShopItem/ShopItem.vue' |
|
|
import ScrollView from '@/base/ScrollView/ScrollView.vue' |
|
|
import ScrollView from '@/base/ScrollView/ScrollView.vue' |
|
|
import { storeToRefs } from 'pinia' |
|
|
import { storeToRefs } from 'pinia' |
|
|
import { useStore } from '@/store/root' |
|
|
import { useStore } from '@/store/root' |
|
|
import { useElementSize, useMutationObserver } from '@vueuse/core' |
|
|
|
|
|
|
|
|
import { useElementSize, useMutationObserver, useThrottleFn } from '@vueuse/core' |
|
|
import { getTranslateValues } from './getTranslateValues' |
|
|
import { getTranslateValues } from './getTranslateValues' |
|
|
|
|
|
|
|
|
const store = useStore() |
|
|
const store = useStore() |
|
|
@ -75,15 +75,13 @@ const indicatorIndex = computed(() => |
|
|
return start > bounds.value[i - 1] && start <= el |
|
|
return start > bounds.value[i - 1] && start <= el |
|
|
}) |
|
|
}) |
|
|
) |
|
|
) |
|
|
useMutationObserver( |
|
|
|
|
|
content, |
|
|
|
|
|
([{ attributeName, target }]) => { |
|
|
|
|
|
|
|
|
const throttledFn = useThrottleFn(([{ attributeName, target }]) => { |
|
|
if (attributeName === 'style') y.value = getTranslateValues(target).y |
|
|
if (attributeName === 'style') y.value = getTranslateValues(target).y |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
}, 500) |
|
|
|
|
|
|
|
|
|
|
|
useMutationObserver(content, throttledFn, { |
|
|
attributes: true |
|
|
attributes: true |
|
|
} |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
}) |
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
list: Array, |
|
|
list: Array, |
|
|
config: Object, |
|
|
config: Object, |
|
|
|