After vue modifies the value passed from the parent component to the child component, the parent component changes as well

the vue parent component passes an array to the child component, which is an array of objects. As the child component traverses a value of the object in the modification array, the parent component changes even more.

Mar.12,2021

the value of the reference type, passing the address, changes, of course, and does not report an error. You can consider deep copy, or simply

computed:{
    childArr:function(){
        return JSON.parse(JSON.stringify(this.parentArr))
    }
}
Menu