简体   繁体   中英

Aurelia child router - use case

I have been doing some initial work to get to grips with the Aurelia framework and am trying to decide if I should be using child routers. This doesn't seem to be covered in much detail on the Aurelia router configuration page . I was wondering if anyone has come across any good use case scenarios that I could examine to get a better understand of where and when to use this feature.

One scenario that springs to mind is 2nd level navigation. Say, for example, you have a main router for the top level sections of your app, eg:

  • Home
  • Products

Those sections could have a child router to handle the 2nd level pages - eg:

  • Products
    • Aircraft
    • Bombs
    • Guns
    • Tanks

Having the sub-views (aircraft, bombs, etc) for the products view in their own child router allows you to easily build out 2nd level navigation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM