2018-12-20 15:50:22 +00:00
|
|
|
export default {
|
|
|
|
router: {
|
|
|
|
extendRoutes(routes, resolve) {
|
2019-03-19 10:25:20 +00:00
|
|
|
const indexRoute = routes.find(route => route.name === 'index')
|
|
|
|
const indexChildRoute = indexRoute.children.find(route => route.name === 'index-child-id')
|
|
|
|
|
|
|
|
Object.assign(indexChildRoute, {
|
2018-12-20 15:50:22 +00:00
|
|
|
components: {
|
2019-03-19 10:25:20 +00:00
|
|
|
default: indexChildRoute.component,
|
2018-12-20 15:50:22 +00:00
|
|
|
left: resolve(__dirname, 'components/childLeft.vue')
|
|
|
|
},
|
|
|
|
chunkNames: {
|
|
|
|
left: 'components/childLeft'
|
|
|
|
}
|
2019-03-19 10:25:20 +00:00
|
|
|
})
|
2018-12-20 15:50:22 +00:00
|
|
|
|
2019-03-19 10:25:20 +00:00
|
|
|
routes
|
|
|
|
.filter(route => ['main', 'another'].includes(route.name))
|
|
|
|
.forEach((route) => {
|
|
|
|
Object.assign(route, {
|
|
|
|
components: {
|
|
|
|
default: route.component,
|
|
|
|
top: resolve(__dirname, 'components/mainTop.vue')
|
|
|
|
},
|
|
|
|
chunkNames: {
|
|
|
|
top: 'components/mainTop'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
2018-12-20 15:50:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|