Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Actually in HomeRoute.js, but object here for simplicity
- const HomeRoute = {
- path: 'home',
- getComponent(location, cb) {
- require.ensure([], (require) => {
- console.log('I got here.');
- cb(null, require('./components/home'));
- });
- }
- }
- // routes.js
- export default {
- component: 'div',
- childRoutes: [
- {
- path: '/',
- component: require('./components/application'),
- childRoutes: [
- HomeRoute
- ]
- }
- ]
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement