From 2e25456c6cdc76f4d4c8afce630348d4fb59b2e6 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Sun, 24 Aug 2025 21:48:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BB=84=E4=BB=B6=E9=80=9A=E4=BF=A1):=20?= =?UTF-8?q?=E5=9C=A8App.ku.vue=E4=B8=AD=E6=9A=B4=E9=9C=B2exposeRef?= =?UTF-8?q?=E5=B9=B6=E9=80=9A=E8=BF=87ref=E5=9C=A8about.vue=E4=B8=AD?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在App.ku.vue中使用defineExpose暴露exposeRef变量,并在about.vue中通过ref引用访问该变量。添加onReady和onShow生命周期钩子来验证访问时机 --- src/App.ku.vue | 6 ++++++ src/pages/about/about.vue | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/App.ku.vue b/src/App.ku.vue index de97b1f..566ba52 100644 --- a/src/App.ku.vue +++ b/src/App.ku.vue @@ -12,6 +12,12 @@ onShow(() => { }) const helloKuRoot = ref('Hello AppKuVue') + +const exposeRef = ref('this is form app.Ku.vue') + +defineExpose({ + exposeRef, +})