export default new Router({
routes: [
{
path: '/',
component: layOut,
children:[
{
path:'/home',
component:Home
},
{
path:'/about',
component: () => import('../views/About.vue')
}
]
}
],
mode:"history"
})
在vue-cli 构建的项目中 打开文件router/index.js
加上:mode:"history"