const AsyncCommonItem = Vue.defineAsyncComponent(()=>{ return new Promise((resolve,reject)=>{ setTimeout(()=>{ resolve({ template:`<div>AsyncCommonItem</div>` }) },3000) }) }) const app = Vue.createApp({ data(){ return { //currentItem:'input-item' } }, methods:{ zmf(){ //this.currentItem = this.currentItem === 'input-item'?'common-item':'input-item' } }, template:` <div> <common-item /> <async-common-item /> </div> ` }) app.component('common-item',{ template:` <div> common-item </div> ` }) app.component('async-common-item',AsyncCommonItem) const vm = app.mount('#root')