From 2e0e797139c634f0a0d05c11acc7d6f7ca234a94 Mon Sep 17 00:00:00 2001 From: sunxi1997 <2351405472@qq.com> Date: Mon, 14 Oct 2024 17:52:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vue3.5=E5=85=BC=E5=AE=B9=20(#518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lazy-component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lazy-component.ts b/src/lazy-component.ts index 7c94223..0fcb3b2 100644 --- a/src/lazy-component.ts +++ b/src/lazy-component.ts @@ -2,7 +2,7 @@ import Lazy from './lazy' import { defineComponent, onMounted, - onUnmounted, + onBeforeUnmount, ref, reactive, computed, @@ -47,8 +47,8 @@ export default (lazy: Lazy) => { lazy.addLazyBox(vm.value) lazy.lazyLoadHandler() }) - - onUnmounted(() => { + + onBeforeUnmount(() => { lazy.removeComponent(vm.value) }) @@ -61,4 +61,4 @@ export default (lazy: Lazy) => { ) } }) -} \ No newline at end of file +}