- 在vue-cli 构建的项目中 打开文件router/index.js
- 加上:mode:"history"
export default new Router({
routes: [
{
path: '/',
component: Index,
children:[
{
path:'/test',
component:Test
},
{
path:'/hello',
component:HelloWorld
}
]
}
],
mode:"history"
})