From 84d1878cee7abb15bcf7e054ef07b4a20e7742f6 Mon Sep 17 00:00:00 2001 From: qiwei Date: Thu, 7 Dec 2023 15:54:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=9C=88=E4=BB=BD=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E5=88=A4=E6=96=AD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/_lang/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/_lang/index.js b/src/common/_lang/index.js index ad2db71c..96f9d141 100644 --- a/src/common/_lang/index.js +++ b/src/common/_lang/index.js @@ -99,10 +99,13 @@ export function initi18n(Vue, config) { } } -export function setDatePickerMonthLocale(locale) { +export function setDatePickerMonthLocale(i18n) { + if (!i18n || !i18n.locale) { + return; + } let datePickerConfig = {}; - let language = locale.locale; - let targetMessage = locale.getLocaleMessage(language); + let language = i18n.locale; + let targetMessage = i18n.getLocaleMessage(language); if (targetMessage) { EXTRA_LOCALE_FIELDS.forEach((fieldName) => { if (targetMessage && targetMessage.DatePicker && targetMessage.DatePicker.lang[fieldName]) {