V
V
Veiwai2021-06-24 21:18:30
Vue.js
Veiwai, 2021-06-24 21:18:30

Vue3 why is reactivity not firing?

There is such a computer that successfully fulfills

const defaultLocation = computed(() => store.getters['ResourcesStore/defaultLocation'])


the value of this computer is assigned to a property of the object.
const actionParams = ref({
    location_id: defaultLocation.value,
})


Why when the value in defaultLocation changes, the old value remains in the property of the object?
60d4cd5c30540080044562.png

from setup method actionParams returns
return {
    actionParams 
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Romanov, 2021-06-24
@Djaler

Well, actually, because it shouldn't. The location_id is set to the original defaultLocation value, and that's it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question