mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 09:39:23 +00:00
28 lines
582 B
Vue
28 lines
582 B
Vue
|
|
<template lang="pug">
|
||
|
|
.row
|
||
|
|
.sixteen.wide.column
|
||
|
|
p You have {{tasksCount}} tasks!
|
||
|
|
.four.wide.column(v-for="taskType in tasksTypes")
|
||
|
|
h3 {{taskType}}s ()
|
||
|
|
ul
|
||
|
|
li(v-for="task in tasks", v-if="task.type === taskType", :key="task.id")
|
||
|
|
span {{task.text}}
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import { mapState } from '../store';
|
||
|
|
|
||
|
|
export default {
|
||
|
|
data () {
|
||
|
|
return {
|
||
|
|
tasksTypes: ['habit', 'daily', 'todo', 'reward'],
|
||
|
|
};
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
...mapState(['tasks']),
|
||
|
|
...mapState({
|
||
|
|
tasksCount: (state) => state.tasks.length,
|
||
|
|
}),
|
||
|
|
},
|
||
|
|
};
|
||
|
|
</script>
|