i liked a global event bus better

This commit is contained in:
Gator
2022-12-01 23:58:04 +01:00
parent 9b39bba6e7
commit aa66c523a3
4 changed files with 82 additions and 36 deletions

View File

@ -2,7 +2,7 @@
<MenuRow row-title="2D Cellular Automata">
<div class="form-field">
<label>Start from last result</label>
<input type="button" value="start" @click="startFromLast" />
<input type="button" value="start" @click="draw2dLast" />
</div>
<div class="form-field">
<input type="button" name="start2d" value="start" @click="draw2d" />
@ -40,17 +40,16 @@ export default {
},
methods: {
draw2d() {
this.$root.$store.state.drawing = 1;
this.$root.$emit("draw2dNew");
this.$store.dispatch("draw2d");
},
draw2dLast() {
this.$store.dispatch("draw2dLast");
},
reset() {
this.$root.$emit("reset");
this.$store.dispatch("reset");
},
stop() {
this.$root.$emit("stop");
},
startFromLast() {
this.$root.$emit("draw2dLast");
this.$store.dispatch("stop");
},
},
};