1
0
mirror of https://github.com/nuxt/nuxt.git synced 2024-12-18 10:17:16 +00:00
Nuxt/test/fixtures/named-views/nuxt.config.js

33 lines
900 B
JavaScript
Raw Normal View History

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'
}
})
})
}
}
}