问题重现:
在引入一个组件 后报Failed to mount component: template or render function not defined.
const routes = [
{
path:'/',
name:'login',
component:() =>import('../views/login.vue')
}]
解决方案:
将组件在上方引入
import login form ‘../views/login.vue’
const routes = [
{
path:'/',
name:'login',
component:login
}];
再重新运行或刷新项目 ,问题完美解决。