mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
#### What type of PR is this? /area ui /kind improvement /milestone 2.22.x #### What this PR does / why we need it: Lazy load some routes to improve initial render performance #### Does this PR introduce a user-facing change? ```release-note 懒加载 Console 和 UC 的部分路由,优化首屏渲染速度 ```
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import BasicLayout from "@console/layouts/BasicLayout.vue";
|
|
import { IconDashboard } from "@halo-dev/components";
|
|
import { definePlugin } from "@halo-dev/ui-shared";
|
|
import { markRaw } from "vue";
|
|
import WidgetCard from "./components/WidgetCard.vue";
|
|
|
|
export default definePlugin({
|
|
components: {
|
|
WidgetCard,
|
|
},
|
|
routes: [
|
|
{
|
|
path: "/",
|
|
component: BasicLayout,
|
|
name: "Root",
|
|
redirect: "/dashboard",
|
|
children: [
|
|
{
|
|
path: "dashboard",
|
|
name: "Dashboard",
|
|
component: () => import("./Dashboard.vue"),
|
|
meta: {
|
|
title: "core.dashboard.title",
|
|
searchable: true,
|
|
menu: {
|
|
name: "core.sidebar.menu.items.dashboard",
|
|
group: "dashboard",
|
|
icon: markRaw(IconDashboard),
|
|
priority: 0,
|
|
mobile: true,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
path: "dashboard/designer",
|
|
name: "DashboardDesigner",
|
|
component: () => import("./DashboardDesigner.vue"),
|
|
meta: {
|
|
title: "core.dashboard_designer.title",
|
|
searchable: false,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
],
|
|
});
|