import Vue from 'vue' import VueRouter from 'vue-router' import auth_wrapper from './vue/auth/wrapper.vue' import noauth_wrapper from './vue/noauth/wrapper.vue' /* (1) Setup Vue, VueRouter, Authentication lib */ require('./setup.js'); /* (2) Get appropriate page data */ let auth_folder = (gs.get.auth) ? 'auth' : 'noauth'; let page_file = gs.get.router.history.current.name || gs.get.routes[auth_folder][0].name; /* (3) Load page script */ require(`./page/${auth_folder}/${page_file}.js`); /* (4) Select appropriate wrapper */ const wrapper = (gs.get.auth) ? auth_wrapper : noauth_wrapper; /* (5) Render view */ Vue.use(VueRouter); new Vue({ el: '#vue', router: gs.get.router, render(h){ return h(wrapper); } })