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

48 lines
1.2 KiB
Vue
Raw Permalink Normal View History

2022-01-03 18:53:38 -05:00
<template>
2022-01-15 00:56:54 -08:00
<div class="pb-20">
<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"
2022-01-11 20:24:49 -08:00
@click="create(process)"
/>
</responsive-grid>
2022-01-15 00:56:54 -08:00
<responsive-grid min="2" mid="3" max="5">
<timekeeping-instrument
v-for="(process, index) in created"
:key="index"
:process="process"
/>
</responsive-grid>
2022-01-04 17:41:36 -05:00
</div>
2022-01-03 18:53:38 -05:00
</template>
<script>
export default {
computed: {
unlocked() {
return this.$store.state.processes.filter((p) => p.visited)
},
created() {
return this.unlocked.filter((p) => p.created)
},
uncreated() {
return this.unlocked.filter((p) => !p.created)
},
},
methods: {
2022-01-11 20:24:49 -08:00
create(process) {
this.$store.commit('createInstrument', process.instrument)
this.$store.commit('spendCurrency', process.cost)
if (process.instrument === 'Mechanical Clock') {
this.$store.commit('unlockTab', 'Apprentices')
this.$store.commit('unlockTab', 'Missions')
}
},
},
2022-01-08 14:04:05 -08:00
}
</script>