From c303ec1a23c4b1fbad4fbda9007af2147dc327e2 Mon Sep 17 00:00:00 2001 From: vben <anncwb@126.com> Date: 星期四, 03 十二月 2020 21:49:32 +0800 Subject: [PATCH] refactor: refactor route --- src/router/routes/modules/demo/charts.ts | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/router/routes/modules/demo/charts.ts b/src/router/routes/modules/demo/charts.ts index 2914100..44fa2f8 100644 --- a/src/router/routes/modules/demo/charts.ts +++ b/src/router/routes/modules/demo/charts.ts @@ -1,23 +1,21 @@ import type { AppRouteModule } from '/@/router/types'; -import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant'; +import { getParentLayout, LAYOUT } from '/@/router/constant'; const charts: AppRouteModule = { - layout: { - path: '/charts', - name: 'Charts', - component: PAGE_LAYOUT_COMPONENT, - redirect: '/charts/apexChart', - meta: { - icon: 'ant-design:area-chart-outlined', - title: 'routes.demo.charts.charts', - }, + path: '/charts', + name: 'Charts', + component: LAYOUT, + redirect: '/charts/apexChart', + meta: { + icon: 'ant-design:area-chart-outlined', + title: 'routes.demo.charts.charts', }, - - routes: [ + children: [ { - path: '/echarts', + path: 'echarts', name: 'Echarts', + component: getParentLayout('Echarts'), meta: { title: 'Echarts', }, @@ -49,7 +47,7 @@ ], }, { - path: '/apexChart', + path: 'apexChart', name: 'ApexChart', meta: { title: 'routes.demo.charts.apexChart', -- Gitblit v1.8.0