Skip to content

Are Getters reactive by default? #513

Discussion options

You must be logged in to vote

Getters are computed properties under the hood. I don't really understand your question. Another way of writing it is:

setup() {
  const user = useUserStore()
  const username = toRef(user, 'username')
  // or if extracting multiple ones
  const { username } = toRefs(user)
  return {
    username
  }
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Comment options

You must be logged in to vote
1 reply
@posva
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants