mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
bug: drop v-model for mutable objects
This commit is contained in:
parent
5fcc4f0684
commit
de5fff311c
4 changed files with 4 additions and 19 deletions
|
@ -37,8 +37,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DoorPlacer v-if="current_step === 0" v-model:doors="doors" />
|
<DoorPlacer v-if="current_step === 0" :doors="doors" />
|
||||||
<DoorChooser v-if="current_step === 1" v-model:doors="doors" />
|
<DoorChooser v-if="current_step === 1" :doors="doors" />
|
||||||
<div v-if="current_step === 2" class="card-content">
|
<div v-if="current_step === 2" class="card-content">
|
||||||
<Calendar :doors="doors" />
|
<Calendar :doors="doors" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
<img :src="$advent22.api_url('user/background_image')" />
|
<img :src="$advent22.api_url('user/background_image')" />
|
||||||
<ThouCanvas>
|
<ThouCanvas>
|
||||||
<PreviewDoor
|
<PreviewDoor
|
||||||
v-for="(_, index) in doors"
|
v-for="(door, index) in doors"
|
||||||
:key="`door-${index}`"
|
:key="`door-${index}`"
|
||||||
v-model:door="doors[index]"
|
:door="door"
|
||||||
/>
|
/>
|
||||||
</ThouCanvas>
|
</ThouCanvas>
|
||||||
</figure>
|
</figure>
|
||||||
|
@ -38,13 +38,8 @@ import PreviewDoor from "./PreviewDoor.vue";
|
||||||
props: {
|
props: {
|
||||||
doors: Array,
|
doors: Array,
|
||||||
},
|
},
|
||||||
emits: ["update:doors"],
|
|
||||||
})
|
})
|
||||||
export default class extends Vue {
|
export default class extends Vue {
|
||||||
public doors!: Door[];
|
public doors!: Door[];
|
||||||
|
|
||||||
public beforeUnmount() {
|
|
||||||
this.$emit("update:doors", this.doors);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -34,7 +34,6 @@ import RectangleCanvas from "./RectangleCanvas.vue";
|
||||||
props: {
|
props: {
|
||||||
doors: Array,
|
doors: Array,
|
||||||
},
|
},
|
||||||
emits: ["update:doors"],
|
|
||||||
})
|
})
|
||||||
export default class extends Vue {
|
export default class extends Vue {
|
||||||
private doors!: Door[];
|
private doors!: Door[];
|
||||||
|
@ -70,9 +69,5 @@ export default class extends Vue {
|
||||||
|
|
||||||
this.doors.splice(idx, 1);
|
this.doors.splice(idx, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public beforeUnmount() {
|
|
||||||
this.$emit("update:doors", this.doors);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -45,7 +45,6 @@ import SVGRect from "../calendar/SVGRect.vue";
|
||||||
props: {
|
props: {
|
||||||
door: Door,
|
door: Door,
|
||||||
},
|
},
|
||||||
emits: ["update:door"],
|
|
||||||
})
|
})
|
||||||
export default class extends Vue {
|
export default class extends Vue {
|
||||||
public door!: Door;
|
public door!: Door;
|
||||||
|
@ -130,10 +129,6 @@ export default class extends Vue {
|
||||||
this.toggle_editing();
|
this.toggle_editing();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public beforeUnmount() {
|
|
||||||
this.$emit("update:door", this.door);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue