const { createApp, ref } = Vue; createApp({ components: { AsyncInfo: { async setup() { // 任务: // 1. 模拟等待 // 2. 返回需要在模板中展示的数据 return {}; }, template: `

这里会展示异步组件内容。

`, }, }, setup() { const showModal = ref(false); return { showModal, }; }, }).mount("#app");