Commit 15679672 authored by Gakki's avatar Gakki

123

parent 6ec2d4ed
...@@ -440,16 +440,25 @@ export default { ...@@ -440,16 +440,25 @@ export default {
}, },
methods: { methods: {
onCheck(keys, node) { onCheck(keys, node) {
console.log(keys, node.node.$children.length) // console.log(keys, node.node.$children.length)
this.checkedKeys = [] this.checkedKeys = []
if(node.node.$children.length > 0) { // 一级菜单 if(node.node.$children.length > 0) { // 一级菜单(有若干个二级菜单)
console.log('一级菜单')
} for(let i = 0; i < node.node.$children.length; i++) {
for(let i = 0; i < node.checkedNodesPositions.length; i++) { // 一级菜单
// console.log(node.checkedNodesPositions[i].pos.split('-').length)
if(node.checkedNodesPositions[i].pos.split('-').length == 3) {
this.checkedKeys.push(keys[i])
}
}
} else {
console.log('二级菜单')
for(let i = 0; i < node.checkedNodesPositions.length; i++) {
// 一级菜单 // 一级菜单
// console.log(node.checkedNodesPositions[i].pos.split('-').length) // console.log(node.checkedNodesPositions[i].pos.split('-').length)
if(node.checkedNodesPositions[i].pos.split('-').length == 2) { if(node.checkedNodesPositions[i].pos.split('-').length == 2) {
this.checkedKeys.push(keys[i]) this.checkedKeys.push(keys[i])
}
} }
} }
// console.log(this.checkedKeys.toString()) // console.log(this.checkedKeys.toString())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment