From f5072436a0ced43e613e01eab6e9c2f200f9976a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E8=89=BA=E9=BA=92?= Date: Sun, 23 Apr 2023 11:16:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(uni-calendar):=20monthSwitch=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/uni-calendar/uni-calendar.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue index 9cc64bdc..80977e64 100644 --- a/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue +++ b/uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue @@ -326,13 +326,12 @@ backToday() { const nowYearMonth = `${this.nowDate.year}-${this.nowDate.month}` const date = this.cale.getDate(new Date()) - const todayYearMonth = `${date.year}-${date.month}` + const todayYearMonth = `${date.year}-${date.month}` + this.init(date.fullDate) - if(nowYearMonth !== todayYearMonth) { - this.monthSwitch() - } - - this.init(date.fullDate) + if(nowYearMonth !== todayYearMonth) { + this.monthSwitch() + } this.change() }, /**