Skip to content

Inject data map into all stores #1278

Discussion options

You must be logged in to vote

You need to assign directly to the $state and then add refs of each added property like shown in docs:

Object.assign(store.$state, DATA_DEFAULTS)

store.data = toRef(store.$state, 'data')

See https://pinia.vuejs.org/core-concepts/plugins.html#adding-new-state

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@bobmcallan
Comment options

@dreambo8563
Comment options

Comment options

You must be logged in to vote
2 replies
@bobmcallan
Comment options

@bobmcallan
Comment options

Answer selected by bobmcallan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants