forked from platypush/platypush
[UI Performance] Lazy initialization for router components.
This commit is contained in:
parent
1a9ac56923
commit
ded64e8dc2
1 changed files with 6 additions and 12 deletions
|
@ -1,45 +1,39 @@
|
||||||
import { createWebHistory, createRouter } from "vue-router";
|
import { createWebHistory, createRouter } from "vue-router";
|
||||||
import Dashboard from "@/views/Dashboard.vue";
|
|
||||||
import NotFound from "@/views/NotFound";
|
|
||||||
import Login from "@/views/Login";
|
|
||||||
import Register from "@/views/Register";
|
|
||||||
import Panel from "@/views/Panel";
|
|
||||||
import Plugin from "@/views/Plugin";
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
name: "Panel",
|
name: "Panel",
|
||||||
component: Panel,
|
component: () => import(/* webpackChunkName: "panel" */ "@/views/Panel"),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/dashboard/:name",
|
path: "/dashboard/:name",
|
||||||
name: "Dashboard",
|
name: "Dashboard",
|
||||||
component: Dashboard,
|
component: () => import(/* webpackChunkName: "dashboard" */ "@/views/Dashboard"),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/plugin/:plugin",
|
path: "/plugin/:plugin",
|
||||||
name: "Plugin",
|
name: "Plugin",
|
||||||
component: Plugin,
|
component: () => import(/* webpackChunkName: "plugin" */ "@/views/Plugin"),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
name: "Login",
|
name: "Login",
|
||||||
component: Login,
|
component: () => import(/* webpackChunkName: "login" */ "@/views/Login"),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/register",
|
path: "/register",
|
||||||
name: "Register",
|
name: "Register",
|
||||||
component: Register,
|
component: () => import(/* webpackChunkName: "register" */ "@/views/Register"),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: "/:catchAll(.*)",
|
path: "/:catchAll(.*)",
|
||||||
component: NotFound,
|
component: () => import(/* webpackChunkName: "notfound" */ "@/views/NotFound"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue