Skip to content

Non-reactive state #810

Nov 19, 2021 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Yes, you should be able to use markRaw, shallowReactive, shallowRef etc. from Vue itself to mark parts of state as non-reactive: https://v3.vuejs.org/api/basic-reactivity.html#reactive

Here is an example, note that adding items to the cart does not show reactively because the rawItems is a shallow ref. However when you click Refresh Cart they will appear as the array is reassigned, which triggers reactivity again.

Replies: 3 comments 4 replies

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

Comment options

You must be logged in to vote
3 replies
@posva
Comment options

@klausXR
Comment options

@Wewill
Comment options

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