Skip to content

Getter does not work in Setup Store #1496

Discussion options

You must be logged in to vote

You have to return the value:

export const useStore = defineStore('default', () => {
    const sampleArg = ref('hello world')

    const demoGetter = computed(() => sampleArg)
+	return { sampleArg, demoGetter }
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yxyx-github
Comment options

Answer selected by yxyx-github
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1493 on July 30, 2022 18:59.