"redirect"
import Vue from 'vue'
import Router from 'vue-router'
import goodinfo from '../components/goodinfo'
import detail from '../components/goodinfodetails/detail'
Vue.use(Router)
export default new Router({
routes: [
{path:'/goodinfo',name:'goodinfo',component:goodinfo,children:[
{path:'/detail',component:detail},
{path:'/review',component:review}
],redirect:'/detail'//在children的后面加一个redirect:'/想要默认展示的子路由名字'
},
]
})
页面每次刷新都会默认展示redirect设置后的子路由