feat(组件通信): 在App.ku.vue中暴露exposeRef并通过ref在about.vue中访问
在App.ku.vue中使用defineExpose暴露exposeRef变量,并在about.vue中通过ref引用访问该变量。添加onReady和onShow生命周期钩子来验证访问时机
This commit is contained in:
@@ -12,6 +12,12 @@ onShow(() => {
|
||||
})
|
||||
|
||||
const helloKuRoot = ref('Hello AppKuVue')
|
||||
|
||||
const exposeRef = ref('this is form app.Ku.vue')
|
||||
|
||||
defineExpose({
|
||||
exposeRef,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user