vuejs / vuex

🗃️ Centralized State Management for Vue.js.
https://vuex.vuejs.org
MIT License
28.4k stars 9.57k forks source link

Mutation on nested properties #2218

Open FrancoisDucobu opened 1 year ago

FrancoisDucobu commented 1 year ago

Hello Guys,

I've got a "strange behavior" on nested properties.

I receive from my api a nested object.

dossier: {
    property1: xxx,
    property2: xxx,
    property3: {
        nested1: xxx,
        nested2: xxx
    }
}

On my view component, I have a mapGetter on this object dossier.

If I do a :value on an input by passing dossier.property3.nested1

The value of nested1 is updated on the store without any mutation.

Is the getter returning a pointer on the nested properties ? Is it normal ?

Thanks for your help

Francois