Method-Style Access Getter #1569
-
ReproductionSteps to reproduce the bugIn Vuex Method-Style Access #
How to do that with Pinia
That not work well
And in that case is like action and not getter (computed)? Expected behaviorActual behaviorAdditional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
And that hot help
|
Beta Was this translation helpful? Give feedback.
-
That work, but it is action and not getter, and actions shouldn't return something. |
Beta Was this translation helpful? Give feedback.
-
It's actually the same as Vuex: Options stores: defineStore('store', {
getters: {
foo: state => (param) => state.bar + param
}
}) Setup Stores: const getItemsByType = computed(() =>
(element: string) => data.value[element] ? data.value[element] : []
) |
Beta Was this translation helpful? Give feedback.
It's actually the same as Vuex:
Options stores:
Setup Stores: