-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Vue-vuex): computed value from vuex state
- Wrap `useStore` to `useAppStore` for types inference. - Passing computed value from vuex state to template.
- Loading branch information
1 parent
4d2cd90
commit dab0c7b
Showing
3 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { useAppStore } from 'src/store'; | ||
defineProps<{ id: string }>(); | ||
const store = useAppStore(); | ||
const columns = computed(() => store.state.board.columns); | ||
</script> | ||
|
||
<template> | ||
<div>Task View {{ id }}</div> | ||
<div v-if="columns"> | ||
<div v-for="column in columns" :key="column.name"> | ||
<ul v-if="column.tasks"> | ||
<li v-for="task in column.tasks" :key="task.id"> | ||
{{ task.name }} | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</template> |