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

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.

主站蜘蛛池模板: 镇巴县| 枣强县| 大庆市| 建宁县| 高阳县| 林芝县| 长岭县| 岳阳市| 鄂温| 桦川县| 郴州市| 墨玉县| 新干县| 卢氏县| 和田县| 米脂县| 扶余县| 绍兴县| 江城| 汽车| 乌拉特前旗| 新化县| 六盘水市| 靖边县| 正安县| 改则县| 盐源县| 武胜县| 名山县| 都昌县| 吴江市| 呼伦贝尔市| 葵青区| 克什克腾旗| 崇义县| 内黄县| 汤原县| 柳州市| 开原市| 临高县| 平潭县|