在router.js设置如下:
index就是默认页面
const routes = [
// 公司项目
{ path: '/', redirect: '/index' },
{path:'/index',component:index},
{
path:'/example',
component:example,
redirect:'/edetail',
children:[
{path:'/edetail',component:edetail}
]
},
{path:'/login',component:login}
]
不使用在根目录设置router的方法,跳转页面带不同的头部信息时容易出现问题