vue組件報錯:
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <Anonymous>
<App> at src/App.vue
<Root>
報錯代碼:
解決方案:
component 改成 components
修改后代碼:

為啥報錯?
vue router 里面有一個模式叫做命名視圖
本來一個頁面里面只能有一個路由視圖對應一個組件,現在可以多個路由視圖對應多個組件。
在使用多個組件時,用components,並寫成對象的形式
在使用單個組件時,用component
更多路由,組件細節:https://blog.csdn.net/xiaodi520520/article/details/88866427