The tree component of element-ui can be selected by default when it is rendered to true, according to the checked attribute of data data. For more information, please refer to it.

ask how to set whether to expand and select nodes by default according to the expanded and checked attributes of publish_treeData data. For example, disabled: true can disable the state

.
<el-tree
    :data="publish_treeData"
    show-checkbox
    node-key="id"
    :default-expanded-keys="defaultExpandedKeys"
    :default-checked-keys="defaultCheckedKeys"
    @setChecked="setCheckedFunc">
</el-tree>
 publish_treeData: [{
                id: 1,
                label: " 2",
                children: [{
                    id: 3,
                    label: " 2-1",
                    children: [{
                        id: 4,
                        label: " 3-1-1"
                        }, {
                        id: 5,
                        label: " 3-1-2",
                        expanded: true,
                        checked: true,
                        disabled: true
                    }]
                }],
Mar.22,2021

traverse your data, settings defaultCheckedKeys


just take a look at api. Generally, you want to find a function directly in api. If you don't have it, you can't do it, or you can only think of your own way to achieve it.

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