路由的 #号这种情况 怎么去掉

来源:7-2 购买详情页 - 添加路由(2)

慕桂英1611074

2017-03-24

http://szimg.mukewang.com/58d4caf70001772805950448.jpg这种情况怎么办

写回答

2回答

fishenal

2017-03-24

上面说得对, routes是 路由映射配置,只能放 path和component 那种对象。

mode: history 是 VueRouter本身的配置,放在实例化 VueRouter的 参数里, 跟routes映射表是同级关系。

1
0

Eden_frontend

2017-03-24

mode:'history'

let routes=[
 {
   path:'/apple',
   component:Apple
 },
 {
   path:'/banana',
   component:Banana
 }
];
let router=new VueRouter({
   mode:'history',
   routes
});

要放在new 里面你放那位置不可能出来

1
0

最容易上手的Vue2.0入门实战教程

快速入门Vue2.0,组件化开发一个数字产品电商平台

3966 学习 · 999 问题

查看课程