adapted components to pinia
This commit is contained in:
@ -63,20 +63,20 @@
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-field">
|
||||
<input type="button" name="start" value="start" @click="draw1d" />
|
||||
<input type="button" name="start" value="start" @click="toggleDraw1d()" />
|
||||
<input
|
||||
type="button"
|
||||
name="reset"
|
||||
class="reset"
|
||||
value="reset"
|
||||
@click="reset"
|
||||
@click="toggleReset"
|
||||
/>
|
||||
</div>
|
||||
</MenuRow>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions, mapState, mapWritableState } from 'pinia'
|
||||
import { mapActions, mapWritableState } from 'pinia'
|
||||
import { presetRules, initialStates } from "./preset.js"
|
||||
import { globalStore } from "../stores/index.js";
|
||||
import MenuRow from "./MenuRow.vue";
|
||||
@ -95,14 +95,11 @@
|
||||
...mapWritableState(
|
||||
globalStore, {
|
||||
initialState: "initial1dState",
|
||||
}
|
||||
),
|
||||
...mapState(
|
||||
globalStore, {
|
||||
rules: "rules1d"
|
||||
}
|
||||
),
|
||||
rules1dFileName() {
|
||||
// TODO: broken
|
||||
return (
|
||||
Object.keys(this.rules)
|
||||
.map((index) => {
|
||||
@ -113,7 +110,7 @@
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapActions(globalStore, ["draw1d", "reset"]),
|
||||
...mapActions(globalStore, ["toggleDraw1d", "toggleReset"]),
|
||||
copyRules() {
|
||||
const rules = JSON.stringify(this.rules);
|
||||
navigator.clipboard.writeText(rules);
|
||||
|
||||
Reference in New Issue
Block a user