The vue.js parent and child components pass values dynamically.

problem description

my tree child component receives the data passed by the parent component, clicks the parent component button to modify the data passed to the child component, and reports such an error.

the environmental background of the problems and what methods you have tried

my sub-component uses watch to listen deeply on incoming objects, but it still doesn"t work.

related codes

/ / Please paste the code text below (do not replace the code with pictures)

< base-tree: treeHeight= "(height-40)": load= "true": treeId= "6655" v MutomonParc treeChange = "treeClick": treeDataObj= "treeObj" > < / base-tree >

    watch: {
        treeDataObj: {
            handler(newVal, oldVal) {
                this.sw = false;
                if (newVal) {
                    this.nodeArray=[];
                    this.index = newVal.index;
                    this.groupId = "";
                    this.isUser = newVal.isUser;
                    this.ztreeDataSourceSync = [];
                    if(newVal.searchText){
                        this.searchText = newVal.searchText;
                        this.treeSearch();
                    }else{
                        this.page = 1;
                        this.loadUserGroupTreeFromEs();
                    }
                }
            },
            deep: true //
        },

what result do you expect? What is the error message actually seen?

Mar.25,2021

the value passed by the parent component to the child component through props cannot be changed directly in the child component.
isn't it obvious to check the code


error message based on this? You cannot change the value of props directly in a subcomponent. If you want to use this value, please decouple it in data or computed. Normally, if you pass an object in props, you will not change it in a subcomponent. Warn's personal guess is that warn

after deep.
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-1e3d87d-4321c.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-1e3d87d-4321c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?