feat(cli): support locales

This commit is contained in:
陈嘉涵
2019-12-06 15:51:20 +08:00
parent 6bd858fac5
commit dc6cc6c5af
16 changed files with 336 additions and 135 deletions

View File

@@ -1,38 +1,11 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import App from './App';
import { routes } from './router';
import { isMobile } from '../common';
import '../common/iframe-router';
import { router } from './router';
if (process.env.NODE_ENV !== 'production') {
Vue.config.productionTip = false;
}
Vue.use(VueRouter);
if (isMobile) {
location.replace('mobile.html' + location.hash);
}
const router = new VueRouter({
mode: 'hash',
routes,
scrollBehavior(to) {
if (to.hash) {
return { selector: to.hash };
}
return { x: 0, y: 0 };
}
});
router.afterEach(() => {
Vue.nextTick(() => window.syncPath());
});
window.vueRouter = router;
new Vue({
el: '#app',
mounted() {