Fix send mode on date update and vice versa to fix multiple router pushes

This commit is contained in:
chfhtw
2025-07-28 09:39:32 +02:00
parent 1b8ab88820
commit 5e0ef4ebab
3 changed files with 11 additions and 35 deletions
+2 -2
View File
@@ -164,7 +164,7 @@ export default {
},
set(value) {
this.internalDate = value;
this.$emit('update:date', value);
this.$emit('update:date', value, this.cMode);
}
},
sMode() {
@@ -182,7 +182,7 @@ export default {
},
set(value) {
this.internalView = value;
this.$emit('update:mode', value);
this.$emit('update:mode', value, this.cDate);
}
}
},
+4 -16
View File
@@ -105,24 +105,12 @@ export default {
return undefined;
return '--event-bg:#' + event.farbe;
},
handleChangeDate(day) {
const focus_date = day.toISODate();
const mode = this.currentMode;
this.$router.push({
name: "LvPlan",
params: {
mode,
focus_date,
lv_id: this.propsViewData?.lv_id || null
}
})
handleChangeDate(day, newMode) {
return this.handleChangeMode(newMode, day);
},
handleChangeMode(newMode) {
handleChangeMode(newMode, day) {
const mode = newMode[0].toUpperCase() + newMode.slice(1)
const focus_date = (this.currentDay instanceof luxon.DateTime)
? this.currentDay.toISODate()
: this.currentDay;
const focus_date = day.toISODate();
this.$router.push({
name: "LvPlan",
@@ -73,24 +73,12 @@ export default {
return undefined;
return '--event-bg:#' + event.farbe;
},
handleChangeDate(day) {
const focus_date = day.toISODate();
const mode = this.currentMode;
this.$router.push({
name: "RoomInformation",
params: {
mode,
focus_date,
ort_kurzbz: this.propsViewData.ort_kurzbz
}
})
handleChangeDate(day, newMode) {
return this.handleChangeMode(newMode, day);
},
handleChangeMode(newMode) {
handleChangeMode(newMode, day) {
const mode = newMode[0].toUpperCase() + newMode.slice(1)
const focus_date = (this.currentDay instanceof luxon.DateTime)
? this.currentDay.toISODate()
: this.currentDay;
const focus_date = day.toISODate();
this.$router.push({
name: "RoomInformation",
@@ -99,7 +87,7 @@ export default {
focus_date,
ort_kurzbz: this.propsViewData.ort_kurzbz
}
})
});
},
updateRange(rangeInterval) {
this.rangeInterval = rangeInterval;