Skip to content

Commit

Permalink
chore: judge set path by route.path
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Feb 4, 2023
1 parent 51ace5f commit be266ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/RouteLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ ${importCode}
export function setupLayouts(routes) {
return routes.map(route => {
const destRoute = {
return {
path: route.path,
component: layouts[route.meta?.layout || '${options.defaultLayout}'],
children: route.path === '/' ? [route] : [{...route, path: ''}]}
}
if (route.path !== '/') destRoute.children = [ {...route, path: ''} ]
return destRoute
})
}
`
Expand Down

0 comments on commit be266ad

Please # to comment.