perf: 降低整体页面持续拖拉时的性能损耗

This commit is contained in:
xiaoxian521
2024-01-12 09:33:07 +08:00
parent a4edee2868
commit 2c2a7284f9
4 changed files with 20 additions and 18 deletions

View File

@@ -3,9 +3,7 @@ import Cropper from "cropperjs";
import { useTippy } from "vue-tippy";
import { ElUpload } from "element-plus";
import type { CSSProperties } from "vue";
import { useResizeObserver } from "@vueuse/core";
import { longpress } from "@/directives/longpress";
import { delay, debounce, isArray, downloadByBase64 } from "@pureadmin/utils";
import {
ref,
unref,
@@ -15,6 +13,13 @@ import {
onUnmounted,
defineComponent
} from "vue";
import {
delay,
debounce,
isArray,
downloadByBase64,
useResizeObserver
} from "@pureadmin/utils";
import {
Reload,
Upload,
@@ -126,9 +131,7 @@ export default defineComponent({
cropper.value?.destroy();
});
useResizeObserver(tippyElRef, () => {
handCropper("reset");
});
useResizeObserver(tippyElRef, () => handCropper("reset"));
async function init() {
const imgEl = unref(imgElRef);