阅读 502

Vue3采坑记录

问题: Vue 无法渲染

[Vue warn]: Failed to resolve component: router-view 
复制代码

image.png

排查

import { createApp } from 'vue'
import App from './App.vue'
import router from './router.js'

createApp(App).mount('#app')

const AppVue = createApp(App)
AppVue.use(router).mount('#app')

复制代码

Vue.mount('#app') 一定要在最后

解决

import { createApp } from 'vue'
import App from './App.vue'
import router from './router.js'

const AppVue = createApp(App)
AppVue.use(router).mount('#app')
复制代码
文章分类
前端
文章标签