Questions about vue tree checking all

 :
<vue-tree :data="routerList"></vue-tree>
:
    <template>
    <ul class="vue-tree">
        <li :class="["vue-tree-li", item.type == 0 ? "type0" :"type1"]" v-for="(item, index) in data">
            <div :class="["children", !item.children ? "forward" : ""]">
                <div  :class="[item.children && item.children.length > 0 ? "" : "forward"]">
                    <span :class="[ "arrow-right",item.show ? "arrow-down" : ""]" v-if="item.children && item.children.length > 0"></span>
                    <el-checkbox v-model="item.checked" @change="checkedBtn(item,index,data)"></el-checkbox>
                    <span @click="getTrees(item, index)" >{{item.routeName}}</span>
                </div>
            </div>
            <myTree :data="item.children" v-if="item.show"></myTree>
        </li>
    </ul>
</template>
<script>
    export default {
        name: "myTree",
        props: ["data"],
        methods: {
            getTrees(item,index) {
                this.$set(this.data[index], "show", this.data[index].show === undefined ? true : !this.data[index].show);
            },
            /*
             * 
             */
            checkedBtn(item, index ,data){
                let itemChecked = item["checked"];
                if (item["children"] && item["children"].length){
                    for (let i in item["children"]){
                        let checked = item["children"][i];
                        this.$set(this.data[index]["children"][i], "checked", this.data[index]["children"][i]["checked"] === undefined ? true : !this.data[index]["children"][i]["checked"]);
                    }
                } else {
                    if (this.data[index].checked === undefined){
                        this.$set(this.data[index], "checked", this.data[index].checked = true);
                    } else {
                        this.$set(this.data[index], "checked", this.data[index].checked ? true : false);
                    }
                }
            }
        }
    }
</script>

clipboard.png

the effect you need to achieve is the same as http://element.eleme.io/-sharp/zh-..
I can"t do it now. After all and all, the subset is unchecked and the parent needs to be unchecked.

Mar.31,2021

all selected control operations should not be controlled by themselves. They are all sent to props, to upload status through events each time they are selected, and assign values from top to bottom

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