Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
fix: occurs reassign in setOptions of calendar (close #2) (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohee-lee7 authored Dec 7, 2018
1 parent dd8e8a4 commit ecb341b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,21 @@ export default {
},
theme: {
handler(newValue) {
this.calendarInstance.setTheme(newValue);
this.calendarInstance.setTheme(this.cloneData(newValue));
},
deep: true
},
week: {
handler(newValue) {
const silent = this.view !== 'week' && this.view !== 'day';
this.calendarInstance.setOptions({week: newValue}, silent);
this.calendarInstance.setOptions({week: this.cloneData(newValue)}, silent);
},
deep: true
},
month: {
handler(newValue) {
const silent = this.view !== 'month';
this.calendarInstance.setOptions({month: newValue}, silent);
this.calendarInstance.setOptions({month: this.cloneData(newValue)}, silent);
},
deep: true
},
Expand Down Expand Up @@ -192,6 +192,9 @@ export default {
this.calendarInstance.destroy();
},
methods: {
cloneData(data) {
return JSON.parse(JSON.stringify(data));
},
addEventListeners() {
calendarEvents.forEach(event => {
this.calendarInstance.on(event, (...args) => this.$emit(event, ...args));
Expand Down

0 comments on commit ecb341b

Please sign in to comment.