mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-11-19 22:46:25 -05:00
use dynamic imports to code split application into smaller js files
This commit is contained in:
parent
a738753578
commit
14d9aab28c
1 changed files with 48 additions and 17 deletions
|
|
@ -1,28 +1,59 @@
|
|||
import { createApp } from 'vue';
|
||||
import { createApp, defineAsyncComponent } from 'vue';
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
import vClickOutside from "click-outside-vue3";
|
||||
|
||||
import App from './components/App.vue';
|
||||
import AboutPage from "./components/about/AboutPage.vue";
|
||||
import SettingsPage from "./components/settings/SettingsPage.vue";
|
||||
import NetworkVisualiserPage from "./components/network-visualiser/NetworkVisualiserPage.vue";
|
||||
import InterfacesPage from "./components/interfaces/InterfacesPage.vue";
|
||||
import NomadNetworkPage from "./components/nomadnetwork/NomadNetworkPage.vue";
|
||||
import MessagesPage from "./components/messages/MessagesPage.vue";
|
||||
import AddInterfacePage from "./components/interfaces/AddInterfacePage.vue";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: [
|
||||
{ path: '/', redirect: '/messages' },
|
||||
{ path: '/about', name: "about", component: AboutPage },
|
||||
{ path: '/interfaces', name: "interfaces", component: InterfacesPage },
|
||||
{ path: '/interfaces/add', name: "interfaces.add", component: AddInterfacePage },
|
||||
{ path: '/interfaces/edit', name: "interfaces.edit", component: AddInterfacePage, props: { interface_name: String } },
|
||||
{ path: '/messages', name: "messages", component: MessagesPage },
|
||||
{ path: '/network-visualiser', name: "network-visualiser", component: NetworkVisualiserPage },
|
||||
{ path: '/nomadnetwork', name: "nomadnetwork", component: NomadNetworkPage },
|
||||
{ path: '/settings', name: "settings", component: SettingsPage },
|
||||
{
|
||||
path: '/',
|
||||
redirect: '/messages',
|
||||
},
|
||||
{
|
||||
name: "about",
|
||||
path: '/about',
|
||||
component: defineAsyncComponent(() => import("./components/about/AboutPage.vue")),
|
||||
},
|
||||
{
|
||||
name: "interfaces",
|
||||
path: '/interfaces',
|
||||
component: defineAsyncComponent(() => import("./components/interfaces/InterfacesPage.vue")),
|
||||
},
|
||||
{
|
||||
name: "interfaces.add",
|
||||
path: '/interfaces/add',
|
||||
component: defineAsyncComponent(() => import("./components/interfaces/AddInterfacePage.vue")),
|
||||
},
|
||||
{
|
||||
name: "interfaces.edit",
|
||||
path: '/interfaces/edit',
|
||||
component: defineAsyncComponent(() => import("./components/interfaces/AddInterfacePage.vue")),
|
||||
props: {
|
||||
interface_name: String,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "messages",
|
||||
path: '/messages',
|
||||
component: defineAsyncComponent(() => import("./components/messages/MessagesPage.vue")),
|
||||
},
|
||||
{
|
||||
name: "network-visualiser",
|
||||
path: '/network-visualiser',
|
||||
component: defineAsyncComponent(() => import("./components/network-visualiser/NetworkVisualiserPage.vue")),
|
||||
},
|
||||
{
|
||||
name: "nomadnetwork",
|
||||
path: '/nomadnetwork',
|
||||
component: defineAsyncComponent(() => import("./components/nomadnetwork/NomadNetworkPage.vue")),
|
||||
},
|
||||
{
|
||||
name: "settings",
|
||||
path: '/settings',
|
||||
component: defineAsyncComponent(() => import("./components/settings/SettingsPage.vue")),
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue