From 2ee3d66d7eae2604611a1aafb291e75b9c5dcda4 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Fri, 8 Dec 2023 12:56:52 +0800 Subject: [PATCH] =?UTF-8?q?JeecgBoot=203.6.1=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E2=80=94=E2=80=94ONLINE=E4=B8=93=E9=A2=98=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/core/onMountedOrActivated.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hooks/core/onMountedOrActivated.ts b/src/hooks/core/onMountedOrActivated.ts index ffabf18..859083d 100644 --- a/src/hooks/core/onMountedOrActivated.ts +++ b/src/hooks/core/onMountedOrActivated.ts @@ -1,10 +1,14 @@ import { nextTick, onMounted, onActivated } from 'vue'; -export function onMountedOrActivated(hook: Fn) { +type HookArgs = { + type: 'mounted' | 'activated'; +} + +export function onMountedOrActivated(hook: Fn) { let mounted: boolean; onMounted(() => { - hook(); + hook({type: 'mounted'}); nextTick(() => { mounted = true; }); @@ -12,7 +16,7 @@ export function onMountedOrActivated(hook: Fn) { onActivated(() => { if (mounted) { - hook(); + hook({type: 'activated'}); } }); }