We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我想向您请教一个问题,就是我在template标签中使用router-view会报错: Failed to mount component:template or render function not defined . 但是把router-view去掉就又正常了,您知道是为什么吗?
App.vue
<template> <div id="app"> <div class="top"> <ul> <li>用户管理系统</li> <li>退出</li> <li>{{accountName}}</li> </ul> <router-view></router-view> </div> </div> </template> <script> export default { data () { return { accountName: 'Admin' } } } </script>
路由
export default new Router({ routes: [ { path:'/' }, { path: '/hello', component: Hello }, { path: '/list', component: UserList } ] })
main.js
new Vue({ el: '#app', router, render:h => h(App) }).$mount('#app')
The text was updated successfully, but these errors were encountered:
routes: [ { path: '/', component: 'Your main component' }, ...... ]
Sorry, something went wrong.
我已经解决了,我在 ./router/index.js 中导入组件的方式错了 const Comp = import('./component/comp') 这样导入就会报错。
const Comp = import('./component/comp')
No branches or pull requests
你好,我想向您请教一个问题,就是我在template标签中使用router-view会报错:
Failed to mount component:template or render function not defined .
但是把router-view去掉就又正常了,您知道是为什么吗?
App.vue
路由
main.js
The text was updated successfully, but these errors were encountered: