mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-15 14:03:36 +08:00
perf: 降低整体页面持续拖拉时的性能损耗
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { useResizeObserver } from "@vueuse/core";
|
||||
import { useResizeObserver } from "@pureadmin/utils";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
||||
import { ref, computed, getCurrentInstance, onMounted } from "vue";
|
||||
@@ -65,9 +65,7 @@ function resizeResult() {
|
||||
innerHeight.value = window.innerHeight - window.innerHeight / 10 - 140;
|
||||
}
|
||||
|
||||
useResizeObserver(resultRef, () => {
|
||||
resizeResult();
|
||||
});
|
||||
useResizeObserver(resultRef, resizeResult);
|
||||
|
||||
function handleScroll(index: number) {
|
||||
const curInstance = instance?.proxy?.$refs[`resultItemRef${index}`];
|
||||
|
||||
@@ -4,12 +4,12 @@ import { emitter } from "@/utils/mitt";
|
||||
import { RouteConfigs } from "../../types";
|
||||
import { useTags } from "../../hooks/useTag";
|
||||
import { routerArrays } from "@/layout/types";
|
||||
import { useFullscreen, onClickOutside } from "@vueuse/core";
|
||||
import { handleAliveRoute, getTopMenu } from "@/router/utils";
|
||||
import { useSettingStoreHook } from "@/store/modules/settings";
|
||||
import { isEqual, isAllEmpty, debounce } from "@pureadmin/utils";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import { ref, watch, unref, toRaw, nextTick, onBeforeUnmount } from "vue";
|
||||
import { useResizeObserver, useFullscreen, onClickOutside } from "@vueuse/core";
|
||||
import { isEqual, isAllEmpty, useResizeObserver } from "@pureadmin/utils";
|
||||
|
||||
import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill";
|
||||
import Fullscreen from "@iconify-icons/ri/fullscreen-fill";
|
||||
@@ -503,10 +503,7 @@ onMounted(() => {
|
||||
});
|
||||
});
|
||||
|
||||
useResizeObserver(
|
||||
scrollbarDom,
|
||||
debounce(() => dynamicTagView())
|
||||
);
|
||||
useResizeObserver(scrollbarDom, dynamicTagView);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
Reference in New Issue
Block a user