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))
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e560b5-440b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e560b5-440b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?