设置好了vue路由,npm run dev一下,不报错,但是路由不生效啊代码如下:
1 回答

慕田峪9158850
TA贡献1794条经验 获得超7个赞
你没有贴App.vue中的代码 我不知道你写了没有
Vue.use(Router)
Vue.use(Vuex)
export default new Router({
routes: [
{
path: '/',
component: App,
redirect:'/in_theaters'},
{
path: '/in_theaters',
component: in_theaters,
},{
path: '/coming_soon',
component: coming_soon,
},
{
path: '/top250',
component: top250,
},
{
path:'*',
redirect:'/'
}
]
})
配置完路由之后
要在App.vue中引用路由路径 这个content 大概的意思就是这个地方加载 你的Home.vue
<el-col :md="14" :lg="18" class="content"> <router-view></router-view> </el-col>
添加回答
举报
0/150
提交
取消