Umi: 配置式路由怎么配置layout

Created on 29 Jun 2018  ·  2Comments  ·  Source: umijs/umi

配置式不会自动加载 layout,怎么配置比较好呢没找到推荐方案

Most helpful comment

要通过嵌套来实现。

{
  path: "/*",
  component: "../layout/",
  exact: true,
  routes: [
    {
      path: "/",
      component: "/index",
      exact: true
    }
  ]
};

All 2 comments

{
path: '/*',
component: '../layout/',
exact: true,
}, {
path: '/',
component: '/index',
exact: true,
},
配置 layout 似乎并不行,后面的路由都没有匹配到,children 没有传进来

要通过嵌套来实现。

{
  path: "/*",
  component: "../layout/",
  exact: true,
  routes: [
    {
      path: "/",
      component: "/index",
      exact: true
    }
  ]
};

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tauruswang picture tauruswang  ·  3Comments

afc163 picture afc163  ·  3Comments

Artoria-0x04 picture Artoria-0x04  ·  3Comments

zemzheng picture zemzheng  ·  3Comments

six-666 picture six-666  ·  3Comments