import Vue from 'vue'; import VueI18n from 'vue-i18n'; import VueRouter from 'vue-router'; import App from './App.vue'; import messages from './lang'; Vue.use(VueI18n); Vue.use(VueRouter); const i18n = new VueI18n({ locale: navigator.language.split('-')[0], fallbackLocale: 'en', messages: messages }); const Landing = () => import('./route/Landing.vue'); const Upload = () => import('./route/Upload.vue'); const router = new VueRouter({ routes: [ { path: '/', component: Landing }, { path: '/c/:codeParam', component: Landing, props: true }, { path: '/u/:codeParam', component: Upload, props: true } ] }); new Vue({ el: '#app', i18n, router, render: h => h(App) });