创建许多组件会减慢我的应用程序吗?

时间:2017-02-27 01:39:43

标签: angular angular2-routing

到目前为止,我有以下玩具类别的路线:

http://localhost:3000/#/mb/to/disney/disney已冻结

以下是迪士尼品牌的路线。想象一下有多少迪斯尼角色。奇迹,变形金刚等等怎么样?

@Routes([
  { path: '/disney moana, component DisneyMoanaComponent },
  { path: '/disney frozen', component: DisneyFrozenComponent },
  { path: '/disney movies', component: DisneyMoviesComponent },
  { path: '/disney', component: DisneyHomeComponent },
  { path: '/', component: DisneyHomeComponent }
]) 

此路线仅适用于我在玩具类别中的迪士尼品牌。对于我的谷歌品牌,更短:

@Routes([
  { path: '/google daydream view', component: DayDreamViewComponent },
  { path: '/daydream view', component: DayDreamViewComponent },
  { path: '/pixel', component: PixelComponent },
  { path: '/chromecast', component: ChromecastComponent },
  { path: '/google home', component: HomeComponent },
  { path: '/google chromecast', component: ChromecastComponent },
  { path: '/google pixel', component: PixelComponent }, 
  { path: '/google', component: GoogleHomeComponent },
  { path: '/', component: GoogleHomeComponent }
])

由于我的组件太多,我应该设计我的应用并根据下面的路由参数显示我的角色页面吗?

http://localhost:3000/#/mb/to/disney/disney/frozen 

0 个答案:

没有答案