lazy load various components
This commit is contained in:
parent
eddcdd1755
commit
870f74e74a
|
@ -1,4 +1,4 @@
|
||||||
import { createApp } from 'vue';
|
import { createApp, defineAsyncComponent } from 'vue';
|
||||||
|
|
||||||
import router from './router';
|
import router from './router';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
|
@ -6,9 +6,12 @@ import App from './App';
|
||||||
import BaseBadge from './components/ui/BaseBadge';
|
import BaseBadge from './components/ui/BaseBadge';
|
||||||
import BaseButton from './components/ui/BaseButton';
|
import BaseButton from './components/ui/BaseButton';
|
||||||
import BaseCard from './components/ui/BaseCard';
|
import BaseCard from './components/ui/BaseCard';
|
||||||
import BaseDialog from './components/ui/BaseDialog';
|
|
||||||
import BaseSpinner from './components/ui/BaseSpinner';
|
import BaseSpinner from './components/ui/BaseSpinner';
|
||||||
|
|
||||||
|
const BaseDialog = defineAsyncComponent(() =>
|
||||||
|
import('./components/ui/BaseDialog')
|
||||||
|
);
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
||||||
app.use(router);
|
app.use(router);
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
import { createRouter, createWebHistory } from 'vue-router';
|
import { createRouter, createWebHistory } from 'vue-router';
|
||||||
|
|
||||||
import UserAuth from '../pages/auth/UserAuth';
|
|
||||||
import CoachDetails from '../pages/coaches/CoachDetails';
|
|
||||||
import CoachesList from '../pages/coaches/CoachesList';
|
import CoachesList from '../pages/coaches/CoachesList';
|
||||||
import CoachRegistration from '../pages/coaches/CoachRegistration';
|
|
||||||
import ContactCoach from '../pages/requests/ContactCoach';
|
|
||||||
import RequestsRecieved from '../pages/requests/RequestsRecieved';
|
|
||||||
import NotFound from '../pages/NotFound';
|
|
||||||
import store from '../store/index.js';
|
import store from '../store/index.js';
|
||||||
|
|
||||||
|
const UserAuth = () => import('../pages/auth/UserAuth');
|
||||||
|
const CoachDetails = () => import('../pages/coaches/CoachDetails');
|
||||||
|
const CoachRegistration = () => import('../pages/coaches/CoachRegistration');
|
||||||
|
const ContactCoach = () => import('../pages/requests/ContactCoach');
|
||||||
|
const RequestsRecieved = () => import('../pages/requests/RequestsRecieved');
|
||||||
|
const NotFound = () => import('../pages/NotFound');
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes: [
|
routes: [
|
||||||
|
|
Reference in New Issue