Failed to resolve component: router-view
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement

vue3解析component: router-view失败  

解决:

//app.use(router) 需放在app.mount('#app')前面  不然加载时router-view、router-link等未被渲染

import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
const app = createApp(App)
app.use(router)
//app.use(router) 需放在app.mount('#app')前面 
app.mount('#app')

Logo

前往低代码交流专区

更多推荐