vue3: Failed to resolve component: router-view
Failed to resolve component: router-viewIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElementvue3解析component: router-view失败解决://app.
·
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')
更多推荐
已为社区贡献2条内容
所有评论(0)