Module not found Error Can‘t resolve ‘..viewsAboutView.vue‘ in ‘CUsers24210Desktophout

ERROR Failed to compile with 1 error 14:21:34

error in ./src/router/index.js

Module not found: Error: Can’t resolve ‘…/views/AboutView.vue’ in ‘C:Users¢10Desktophoutaisrc outer’

ERROR in ./src/router/index.js 35:11-37:29
Module not found: Error: Can’t resolve ‘…/views/AboutView.vue’ in ‘C:Users¢10Desktophoutaisrc outer’
@ ./src/main.js 37:0-30 52:10-16

webpack compiled with 1 error

解决方法

这个错误是没有定义AboutView组件导致的,我出现这个错误是因为把这个组件删除后,没有删除相对应的引用。删除路由index.js下的引用即可解决问题

import Vue from ‘vue’

import VueRouter from ‘vue-router’

// import Main from ‘…/views/Main.vue’

Vue.use(VueRouter)

const routes = [

{

path: ‘/’,

name: ‘Main’,

component: ()=>import(‘…/views/Main.vue’),

children:[

{

path:‘/home’,

name:‘home’,

component:()=>import(‘…/views/home’)

},

{

path:‘/user’,

name:‘user’,

component:()=>import(‘…/views/User’)

},

]

},

]

const router = new VueRouter({

mode: ‘history’,

base: process.env.BASE_URL,

routes

})

export default router

先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦

猜你喜欢

转载自blog.csdn.net/m0_67403240/article/details/126112738