[Vuejs]-Vue re-render of one component breaks rendering of other

0👍

While I do not know why this problem occured, I found a way to react to changes of a single object in store in two different components: Make use of store getters and computed():

Component A

const refs: {
  example?: Exercise,
} = reactive({
  example: computed(() => store.getters['examples/selected'] as Exercise),
})

The same code could be used in Component B. Alternatively, since B is a child of A, A could pass the refs down to B.

Leave a comment