首先需要了解vue內(nèi)置組件 component
渲染一個(gè)“元組件”為動(dòng)態(tài)組件混坞。依?is?的值匈勋,來決定哪個(gè)組件被渲染第步。
<component :is="currentComponent"></component>
實(shí)例數(shù)據(jù)部分协屡,組件名稱
路由配置組件部分赊抖,按需加載對(duì)應(yīng)組件
tap 對(duì)應(yīng)組件名稱,使currentComponent 對(duì)應(yīng) 組件名稱