mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
docs: fix locales
This commit is contained in:
parent
1dd0d42b5f
commit
8641b8b256
@ -3,11 +3,16 @@ import Locale from '../../src/locale';
|
||||
import Lazyload from '../../src/lazyload';
|
||||
import { get } from '../../src/utils';
|
||||
import { camelize } from '../../src/utils/format/string';
|
||||
import enUS from '../../src/locale/lang/en-US';
|
||||
|
||||
Vue.use(Lazyload, {
|
||||
lazyComponent: true
|
||||
});
|
||||
|
||||
Locale.add({
|
||||
'en-US': enUS
|
||||
});
|
||||
|
||||
// helper for demo locales
|
||||
Vue.mixin({
|
||||
computed: {
|
||||
@ -40,6 +45,14 @@ Vue.mixin({
|
||||
}
|
||||
});
|
||||
|
||||
window.vueRouter.afterEach(to => {
|
||||
const { lang } = (to.meta) || {};
|
||||
|
||||
if (lang) {
|
||||
Locale.use(lang);
|
||||
}
|
||||
});
|
||||
|
||||
// add some basic locale messages
|
||||
Locale.add({
|
||||
'zh-CN': {
|
||||
|
Loading…
x
Reference in New Issue
Block a user