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

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.

主站蜘蛛池模板: 德化县| 防城港市| 赫章县| 德格县| 永福县| 昆山市| 宣威市| 乐平市| 灵台县| 盐津县| 读书| 梁河县| 林甸县| 革吉县| 海伦市| 蒙山县| 海晏县| 灵寿县| 双桥区| 双城市| 江门市| 凉山| 梅河口市| 株洲县| 凤翔县| 增城市| 佛山市| 广安市| 绥江县| 贵州省| 甘泉县| 连州市| 邓州市| 广丰县| 武汉市| 大田县| 太湖县| 永泰县| 启东市| 汾阳市| 铜梁县|