fix: use dynamic imports instead of old async components for router views
prepare for vue 3, see: https://next.router.vuejs.org/guide/advanced/lazy-loading.html
This commit is contained in:
parent
9a72d3dc36
commit
0c678b6e44
1 changed files with 11 additions and 46 deletions
|
@ -3,8 +3,6 @@ import Router from 'vue-router'
|
||||||
|
|
||||||
import HomeComponent from '../views/Home'
|
import HomeComponent from '../views/Home'
|
||||||
import NotFoundComponent from '../views/404'
|
import NotFoundComponent from '../views/404'
|
||||||
import LoadingComponent from '../components/misc/loading'
|
|
||||||
import ErrorComponent from '../components/misc/error'
|
|
||||||
import About from '../views/About'
|
import About from '../views/About'
|
||||||
// User Handling
|
// User Handling
|
||||||
import LoginComponent from '../views/user/Login'
|
import LoginComponent from '../views/user/Login'
|
||||||
|
@ -48,51 +46,18 @@ import NamespaceSettingDelete from '../views/namespaces/settings/delete'
|
||||||
// Saved Filters
|
// Saved Filters
|
||||||
import CreateSavedFilter from '../views/filters/CreateSavedFilter'
|
import CreateSavedFilter from '../views/filters/CreateSavedFilter'
|
||||||
|
|
||||||
const PasswordResetComponent = () => ({
|
const PasswordResetComponent = () => import('../views/user/PasswordReset')
|
||||||
component: import('../views/user/PasswordReset'),
|
const GetPasswordResetComponent = () => import('../views/user/RequestPasswordReset')
|
||||||
loading: LoadingComponent,
|
const UserSettingsComponent = () => import('../views/user/Settings')
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
const GetPasswordResetComponent = () => ({
|
|
||||||
component: import('../views/user/RequestPasswordReset'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
const UserSettingsComponent = () => ({
|
|
||||||
component: import('../views/user/Settings'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
// List Handling
|
|
||||||
const NewListComponent = () => ({
|
|
||||||
component: import('../views/list/NewList'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
// Namespace Handling
|
|
||||||
const NewNamespaceComponent = () => ({
|
|
||||||
component: import('../views/namespaces/NewNamespace'),
|
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
|
|
||||||
const EditTeamComponent = () => ({
|
// List Handling
|
||||||
component: import('../views/teams/EditTeam'),
|
const NewListComponent = () => import('../views/list/NewList')
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
// Namespace Handling
|
||||||
timeout: 60000,
|
const NewNamespaceComponent = () => import('../views/namespaces/NewNamespace')
|
||||||
})
|
|
||||||
const NewTeamComponent = () => ({
|
const EditTeamComponent = () => import('../views/teams/EditTeam')
|
||||||
component: import('../views/teams/NewTeam'),
|
const NewTeamComponent = () => import('../views/teams/NewTeam')
|
||||||
loading: LoadingComponent,
|
|
||||||
error: ErrorComponent,
|
|
||||||
timeout: 60000,
|
|
||||||
})
|
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue