Browse Source

日历优化

dev-map-local
dai 3 years ago
parent
commit
6ac6b290bc
  1. 15
      src/views/modules/communityParty/calendar/cpts/calendar.vue
  2. 1
      src/views/modules/communityParty/calendar/index.vue

15
src/views/modules/communityParty/calendar/cpts/calendar.vue

@ -120,6 +120,7 @@ export default {
watch: { watch: {
visibleCalendar() { visibleCalendar() {
this.init(); this.init();
// this.iniDate();
}, },
}, },
mounted() { mounted() {
@ -134,13 +135,19 @@ export default {
init() { init() {
if (!this.currentDate) { if (!this.currentDate) {
this.handleClickDate( this.iniDate();
this.visibleCalendar.find((item) => item.isToday) ||
this.visibleCalendar.filter((item) => item.thisMonth)[0]
);
} }
}, },
iniDate() {
this.handleClickDate(
this.visibleCalendar
.filter((item) => item.thisMonth)
.find((item) => item.isToday) ||
this.visibleCalendar.filter((item) => item.thisMonth)[0]
);
},
handleClickDate(item) { handleClickDate(item) {
console.log("点击日历日期", item); console.log("点击日历日期", item);
this.currentDate = item.format; this.currentDate = item.format;

1
src/views/modules/communityParty/calendar/index.vue

@ -450,6 +450,7 @@ export default {
}, },
currentYear: function (val) { currentYear: function (val) {
console.log("watch--currentYear", val); console.log("watch--currentYear", val);
this.currentMonth = 0;
this.getMonthData(); this.getMonthData();
}, },
}, },

Loading…
Cancel
Save