mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-12-24 05:23:04 +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>
|
||||
|
||||
<DoorPlacer v-if="current_step === 0" v-model:doors="doors" />
|
||||
<DoorChooser v-if="current_step === 1" v-model:doors="doors" />
|
||||
<DoorPlacer v-if="current_step === 0" :doors="doors" />
|
||||
<DoorChooser v-if="current_step === 1" :doors="doors" />
|
||||
<div v-if="current_step === 2" class="card-content">
|
||||
<Calendar :doors="doors" />
|
||||
</div>
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
<img :src="$advent22.api_url('user/background_image')" />
|
||||
<ThouCanvas>
|
||||
<PreviewDoor
|
||||
v-for="(_, index) in doors"
|
||||
v-for="(door, index) in doors"
|
||||
:key="`door-${index}`"
|
||||
v-model:door="doors[index]"
|
||||
:door="door"
|
||||
/>
|
||||
</ThouCanvas>
|
||||
</figure>
|
||||
|
@ -38,13 +38,8 @@ import PreviewDoor from "./PreviewDoor.vue";
|
|||
props: {
|
||||
doors: Array,
|
||||
},
|
||||
emits: ["update:doors"],
|
||||
})
|
||||
export default class extends Vue {
|
||||
public doors!: Door[];
|
||||
|
||||
public beforeUnmount() {
|
||||
this.$emit("update:doors", this.doors);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -34,7 +34,6 @@ import RectangleCanvas from "./RectangleCanvas.vue";
|
|||
props: {
|
||||
doors: Array,
|
||||
},
|
||||
emits: ["update:doors"],
|
||||
})
|
||||
export default class extends Vue {
|
||||
private doors!: Door[];
|
||||
|
@ -70,9 +69,5 @@ export default class extends Vue {
|
|||
|
||||
this.doors.splice(idx, 1);
|
||||
}
|
||||
|
||||
public beforeUnmount() {
|
||||
this.$emit("update:doors", this.doors);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -45,7 +45,6 @@ import SVGRect from "../calendar/SVGRect.vue";
|
|||
props: {
|
||||
door: Door,
|
||||
},
|
||||
emits: ["update:door"],
|
||||
})
|
||||
export default class extends Vue {
|
||||
public door!: Door;
|
||||
|
@ -130,10 +129,6 @@ export default class extends Vue {
|
|||
this.toggle_editing();
|
||||
}
|
||||
}
|
||||
|
||||
public beforeUnmount() {
|
||||
this.$emit("update:door", this.door);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue