This repository has been archived on 2024-03-13. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
timekeeper/pages/index.vue
2022-01-12 12:11:30 -08:00

44 lines
1,004 B
Vue

<template>
<div>
<responsive-grid class="mb-4">
<progress-button
v-for="(process, index) in uncreated"
:key="index"
:label="process.instrument"
:max="process.cost"
:value="$store.state.currency"
@click="create(process)"
/>
</responsive-grid>
<responsive-grid min="2" mid="4" max="6">
<timekeeping-instrument
v-for="(process, index) in created"
:key="index"
:process="process"
/>
</responsive-grid>
</div>
</template>
<script>
export default {
computed: {
unlocked() {
return this.$store.state.processes.filter((p) => p.unlocked)
},
created() {
return this.unlocked.filter((p) => p.created)
},
uncreated() {
return this.unlocked.filter((p) => !p.created)
},
},
methods: {
create(process) {
this.$store.commit('createInstrument', process.instrument)
this.$store.commit('spendCurrency', process.cost)
},
},
}
</script>