Created
July 28, 2022 14:28
-
-
Save lloydjatkinson/9a2e01a9e82e0edfcf4815662995f4d8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import { defineComponent } from 'vue'; | |
import { mapActions, mapStores } from 'pinia'; | |
import { useTodoStore } from '../store'; | |
export default defineComponent({ | |
name: 'TodoList', | |
computed: { | |
...mapStores(useTodoStore), | |
notStarted (): readonly Todo[] { | |
return this.todoStore.notStarted; | |
}, | |
finished (): readonly Todo[] { | |
return this.todoStore.done; | |
}, | |
}, | |
methods: { | |
...mapActions(useTodoStore, [ | |
'addNew', | |
'remove', | |
'updateDescription', | |
'updateTitle', | |
'updateProgress', | |
'updateAllProgress', | |
]), | |
addTestTodo () { | |
this.addNew({ title: 'test todo', description: '', progress: Progress.NotStarted }); | |
}, | |
}, | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment