diff --git a/pages/vue/datetime-picker/datetime-picker.vue b/pages/vue/datetime-picker/datetime-picker.vue index 94e0ea4d..b885e23a 100644 --- a/pages/vue/datetime-picker/datetime-picker.vue +++ b/pages/vue/datetime-picker/datetime-picker.vue @@ -21,7 +21,7 @@ - + @@ -77,9 +77,9 @@ console.log('日期时间范围选:', this.datetimeRange); } }, - methods: { - show(){ - console.log('----show事件:'); + methods: { + show(){ + console.log('----show事件:'); }, change(e) { console.log('----change事件:', e); @@ -106,6 +106,9 @@ `${addZero ? this.addZero(hour) : hour}:${addZero ? this.addZero(minute) : minute}` : `${addZero ? this.addZero(hour) : hour}:${addZero ? this.addZero(minute) : minute}:${addZero ? this.addZero(second) : second}` }, + calendarClick(e){ + console.log("点击的日期:",JSON.stringify(e)) + }, addZero(num) { if (num < 10) { num = `0${num}` diff --git a/uni_modules/uni-datetime-picker/changelog.md b/uni_modules/uni-datetime-picker/changelog.md index 0e764775..8798e937 100644 --- a/uni_modules/uni-datetime-picker/changelog.md +++ b/uni_modules/uni-datetime-picker/changelog.md @@ -1,3 +1,5 @@ +## 2.2.34(2024-04-24) +- 新增 日期点击事件,在点击日期时会触发该事件。 ## 2.2.33(2024-04-15) - 修复 抖音小程序事件传递失效bug ## 2.2.32(2024-02-20) diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue index 31f7340e..e6fe5944 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue @@ -541,8 +541,8 @@ /** * 变化触发 */ - change() { - if (!this.insert) return + change(isSingleChange) { + if (!this.insert && !isSingleChange) return this.setEmit('change') }, /** @@ -611,7 +611,7 @@ this.tempRange.before = this.cale.multipleStatus.before this.tempRange.after = this.cale.multipleStatus.after } - this.change() + this.change(true) }, changeMonth(type) { let newDate @@ -944,4 +944,4 @@ } /* #endif */ - + diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue index 5a4025b0..11fc45a9 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue @@ -1,1051 +1,1057 @@ - - - - diff --git a/uni_modules/uni-datetime-picker/package.json b/uni_modules/uni-datetime-picker/package.json index c8709499..4d1b05c5 100644 --- a/uni_modules/uni-datetime-picker/package.json +++ b/uni_modules/uni-datetime-picker/package.json @@ -1,7 +1,7 @@ { "id": "uni-datetime-picker", "displayName": "uni-datetime-picker 日期选择器", - "version": "2.2.33", + "version": "2.2.34", "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", "keywords": [ "uni-datetime-picker",