mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
perf: optimize scroll handing in App.vue
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useDebounceFn, useThrottleFn, useToggle } from '@vueuse/core'
|
||||
import { useThrottleFn, useToggle } from '@vueuse/core'
|
||||
import type { Ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import browser from 'webextension-polyfill'
|
||||
@@ -204,7 +204,7 @@ function handleAdaptToOtherPageStylesChange() {
|
||||
document.documentElement.classList.remove('bewly-design')
|
||||
}
|
||||
|
||||
const handleOsScroll = useDebounceFn(() => {
|
||||
function handleOsScroll() {
|
||||
const osInstance = scrollbarRef.value?.osInstance()
|
||||
const { viewport } = osInstance.elements()
|
||||
const { scrollTop, scrollHeight, clientHeight } = viewport // get scroll offset
|
||||
@@ -219,7 +219,7 @@ const handleOsScroll = useDebounceFn(() => {
|
||||
|
||||
if (isHomePage())
|
||||
topBarRef.value?.handleScroll()
|
||||
}, 50)
|
||||
}
|
||||
|
||||
function handleBlockAds() {
|
||||
// Do not use the "ads" keyword. AdGuard, AdBlock, and some ad-blocking extensions will
|
||||
|
||||
Reference in New Issue
Block a user