官术网_书友最值得收藏!

Router configuration

The router configuration defines all the potential router states of the application. Let's look at an example:

[
  {
    path: ':folder',
    children: [
      {
        path: '',
        component: ConversationsCmp
      },
      {
        path: ':id',
        component: ConversationCmp,
        children: [
          { path: 'messages', component: MessagesCmp },
          { path: 'messages/:id', component: MessageCmp }
        ]
      }
    ]
  },
  {
    path: 'compose',
    component: ComposeCmp,
    outlet: 'popup'
  },
  {
    path: 'message/:id',
    component: PopupMessageCmp,
    outlet: 'popup'
  }
]

Don't worry about understanding all the details. I will cover them in later chapters. For now, let's depict the configuration as follows:

As you can see the router configuration is a tree, with every node representing a route. Some nodes have components associated with them, some do not. We also use color to designate different outlets, where an outlet is a location in the component tree where a component is placed.

主站蜘蛛池模板: 张家口市| 江北区| 饶平县| 鹿泉市| 邯郸市| 阿克苏市| 唐海县| 龙里县| 应城市| 铁力市| 正定县| 什邡市| 凤阳县| 辽阳县| 富平县| 鹰潭市| 会同县| 武平县| 手机| 长沙市| 谢通门县| 新化县| 曲靖市| 靖州| 将乐县| 南部县| 玉龙| 郧西县| 汝南县| 中方县| 日照市| 建德市| 孝感市| 阿拉善左旗| 黔西| 阜新| 云龙县| 来宾市| 郸城县| 肥东县| 五常市|