0👍
For anyone who might have something similar in the future. You can pass in a value to a getter like so
...mapState(useThreadsStore, {
thread(store) {
return store.thread(this.id);
},
}),
0👍
export const useStore = defineStore('main', {
getters: {
getUserById: (state) => {
return (userId) => state.users.find((user) => user.id === userId)
},
},
})```
[official docs][1]
[1]: https://pinia.vuejs.org/core-concepts/getters.html#Passing-arguments-to-getters
- [Vuejs]-I have a windows application in which we are using a chromium browser to open new html dialog having vuetify components
- [Vuejs]-Mock async action in Pinia
Source:stackexchange.com