2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-05-30 13:24:07 +03:00

docs: zh-cn

This commit is contained in:
mengxiong10
2019-11-12 18:52:17 +08:00
parent 23781ef299
commit 4ddfb4e8a6
10 changed files with 167 additions and 29 deletions
+1 -1
View File
@@ -88,7 +88,7 @@
import { parse, format } from 'date-format-parse';
import { isValidDate, isValidRangeDate, getValidDate } from './util/date';
import { pick, isObject, mergeDeep } from './util/base';
import { locale as getLocale } from './locale';
import { getLocale } from './locale';
import Popup from './popup';
import IconCalendar from './icon/icon-calendar';
import IconClose from './icon/icon-close';
+13 -2
View File
@@ -4,11 +4,22 @@ let defaultLocale = 'en';
const locales = {};
locales[defaultLocale] = enUS;
export function locale(name, object) {
export function locale(name, object, isLocal) {
if (typeof name !== 'string') return locales[defaultLocale];
let l;
if (locales[name]) {
l = name;
}
if (object) {
locales[name] = object;
defaultLocale = name;
l = name;
}
if (!isLocal) {
defaultLocale = l;
}
return locales[name] || locales[defaultLocale];
}
export function getLocale(name) {
return locale(name, null, true);
}
+1 -1
View File
@@ -1,5 +1,5 @@
import { format } from 'date-format-parse';
import { locale as getLocale } from '../locale';
import { getLocale } from '../locale';
export default {
inject: {
+1 -1
View File
@@ -1,4 +1,4 @@
import { locale as getLocale } from '../locale';
import { getLocale } from '../locale';
export default {
inject: {