Make event & create event & map async components

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-05-31 15:13:07 +02:00
parent 55cd3bc54a
commit 0a1f955194
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 11 additions and 6 deletions

View file

@ -1,9 +1,12 @@
import EventList from '@/views/Event/EventList.vue';
import Location from '@/views/Location.vue';
import CreateEvent from '@/views/Event/Create.vue';
import Event from '@/views/Event/Event.vue';
import { RouteConfig } from 'vue-router';
// tslint:disable:space-in-parens
const createEvent = () => import(/* webpackChunkName: "create-event" */ '@/views/Event/Create.vue');
const event = () => import(/* webpackChunkName: "event" */ '@/views/Event/Event.vue');
// tslint:enable
export enum EventRouteName {
EVENT_LIST = 'EventList',
CREATE_EVENT = 'CreateEvent',
@ -22,13 +25,13 @@ export const eventRoutes: RouteConfig[] = [
{
path: '/events/create',
name: EventRouteName.CREATE_EVENT,
component: CreateEvent,
component: createEvent,
meta: { requiredAuth: true },
},
{
path: '/events/:id/edit',
name: EventRouteName.EDIT_EVENT,
component: CreateEvent,
component: createEvent,
props: true,
meta: { requiredAuth: true },
},
@ -41,7 +44,7 @@ export const eventRoutes: RouteConfig[] = [
{
path: '/events/:uuid',
name: EventRouteName.EVENT,
component: Event,
component: event,
props: true,
meta: { requiredAuth: false },
},

View file

@ -249,7 +249,9 @@ import EventFullDate from '@/components/Event/EventFullDate.vue';
EventCard,
BIcon,
DateCalendarIcon,
'map-leaflet': () => import('@/components/Map.vue'),
// tslint:disable:space-in-parens
'map-leaflet': () => import(/* webpackChunkName: "map" */ '@/components/Map.vue'),
// tslint:enable
},
apollo: {
event: {