Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // Actually in HomeRoute.js, but object here for simplicity
  2. const HomeRoute = {
  3. path: 'home',
  4. getComponent(location, cb) {
  5. require.ensure([], (require) => {
  6. console.log('I got here.');
  7. cb(null, require('./components/home'));
  8. });
  9. }
  10. }
  11.  
  12. // routes.js
  13. export default {
  14. component: 'div',
  15. childRoutes: [
  16. {
  17. path: '/',
  18. component: require('./components/application'),
  19. childRoutes: [
  20. HomeRoute
  21. ]
  22. }
  23. ]
  24. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement