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:
+1
-1
@@ -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
@@ -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
@@ -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
@@ -1,4 +1,4 @@
|
||||
import { locale as getLocale } from '../locale';
|
||||
import { getLocale } from '../locale';
|
||||
|
||||
export default {
|
||||
inject: {
|
||||
|
||||
Reference in New Issue
Block a user