switching to composition API

This commit is contained in:
Gator
2022-12-21 23:45:22 +01:00
parent c825752405
commit 7c9d7d2d5b
11 changed files with 441 additions and 576 deletions

View File

@ -1,13 +1,19 @@
<script setup>
import { globalStore } from "../stores/index.js";
const store = globalStore();
</script>
<template>
<div class="form-field">
<div class="form-field">
<label>
Loop
<input
:value="loop"
:value="store.loop"
type="checkbox"
:checked="loop"
@input="toggleLoop()"
:checked="store.loop"
@input="store.toggleLoop()"
/>
</label>
</div>
@ -16,43 +22,25 @@
name="next"
class="next"
value="Next"
@click="toggleNext()"
@click="store.toggleNext()"
/>
<input
type="button"
name="stop"
class="stop"
value="stop"
@click="toggleStop()"
@click="store.toggleStop()"
/>
<input
type="button"
name="reset"
class="reset"
value="reset"
@click="toggleReset()"
@click="store.toggleReset()"
/>
</div>
</template>
<script>
import { mapState, mapActions } from "pinia";
import { globalStore } from "../stores/index.js";
export default {
name: "MenuReset",
computed: {
...mapState(globalStore, ["loop"]),
},
methods: {
...mapActions(globalStore, [
"toggleReset",
"toggleStop",
"toggleLoop",
"toggleNext",
]),
},
};
</script>
<style scoped>
.form-field {
display: flex;