If the element-ui tree component of vue is not fully selected, the node-key of the parent node will not be put into the bound array


                            <el-tree
                                ref="roleTree"
                                :data="treeList"
                                show-checkbox
                                node-key="MENU_ID"
                                :default-checked-keys="rolesVal"
                                :props="props"
                                @check-change="handleCheckChange">
                            </el-tree>

clipboard.png
now I need to pass the MENU_ID of the parent node managed by the system to the backend. What to do? if it is not all selected by default, if the child node is passed directly, only if all is selected, the ID of the parent node will be passed. The official document is confused

.
Mar.28,2021

this.$refs.tree2.getCheckedKeys (). Concat (this.$refs.tree2.getHalfCheckedKeys ()) is fine. You don't need to change anything


 node_modules/element-ui/lib/element-ui.common.js
TreeStore.prototype.getCheckedKeysifnode.checked
if (node.checked||node.indeterminate)

to get the selected and semi-selected buttons id

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