habitica/website/client/components/userTasks.vue

26 lines
476 B
Vue
Raw Normal View History

<template lang="pug">
.row
.col(v-for="taskType in tasksTypes")
2017-01-17 17:07:02 +00:00
h3 {{taskType}}s
ul
2017-01-17 17:07:02 +00:00
task(v-for="task in tasks", v-if="task.type === taskType", :key="task.id", :task="task")
</template>
<script>
2017-01-17 17:07:02 +00:00
import Task from './task';
import { mapState } from '../store';
export default {
2017-01-17 17:07:02 +00:00
components: {
Task,
},
data () {
return {
tasksTypes: ['habit', 'daily', 'todo', 'reward'],
};
},
computed: {
...mapState(['tasks']),
},
};
</script>