Nuxt/test/fixtures/named-views/nuxt.config.js
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

33 lines
900 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'
}
})
})
}
}
}