mirror of
https://github.com/youzan/vant.git
synced 2026-05-05 01:00:55 +08:00
chore(cli): vue global api change
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Vue from 'vue';
|
||||
import { nextTick } from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import { isMobile, decamelize } from '../common';
|
||||
import { config, documents } from 'site-desktop-shared';
|
||||
@@ -48,7 +48,7 @@ function getRoutes() {
|
||||
if (locales) {
|
||||
routes.push({
|
||||
path: '*',
|
||||
redirect: route => `/${getLangFromRoute(route)}/`,
|
||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
||||
});
|
||||
} else {
|
||||
routes.push({
|
||||
@@ -66,7 +66,7 @@ function getRoutes() {
|
||||
});
|
||||
}
|
||||
|
||||
names.forEach(name => {
|
||||
names.forEach((name) => {
|
||||
const { component, lang } = parseName(name);
|
||||
|
||||
if (component === 'home') {
|
||||
@@ -98,8 +98,6 @@ function getRoutes() {
|
||||
return routes;
|
||||
}
|
||||
|
||||
Vue.use(VueRouter);
|
||||
|
||||
export const router = new VueRouter({
|
||||
mode: 'hash',
|
||||
routes: getRoutes(),
|
||||
@@ -113,7 +111,7 @@ export const router = new VueRouter({
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
Vue.nextTick(() => window.syncPath());
|
||||
nextTick(() => window.syncPath());
|
||||
});
|
||||
|
||||
window.vueRouter = router;
|
||||
|
||||
Reference in New Issue
Block a user