mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 17:37:14 +00:00
33 lines
899 B
JavaScript
33 lines
899 B
JavaScript
export default {
|
|
router: {
|
|
extendRoutes(routes, resolve) {
|
|
const indexRoute = routes.find(route => route.name === 'index')
|
|
const indexChildRoute = indexRoute.children.find(route => route.name === 'index-child-id')
|
|
|
|
Object.assign(indexChildRoute, {
|
|
components: {
|
|
default: indexChildRoute.component,
|
|
left: resolve(__dirname, 'components/childLeft.vue')
|
|
},
|
|
chunkNames: {
|
|
left: 'components/childLeft'
|
|
}
|
|
})
|
|
|
|
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'
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|