Merge pull request #93 from TheFoot/feature/node-expand-collapse

Feature: Added toggle() method to the node passed to TreeNode.click()…
This commit is contained in:
ayou
2020-10-28 09:56:11 +08:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -219,7 +219,7 @@ Or just register locally like the example below.
| name | params | description |
| :---------: | :--------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| click | TreeNode | Trigger when clicking a tree node |
| click | TreeNode | Trigger when clicking a tree node. You can call `toggle` of `TreeNode` to toggle the folder node. |
| change-name | {'id', 'oldName', 'newName'} | Trigger after changing a node's name |
| delete-node | TreeNode | Trigger when clicking `delNode` button. You can call `remove` of `TreeNode` to remove the node. |
| add-node | TreeNode | Trigger after adding a new node |

View File

@@ -272,7 +272,10 @@ export default {
},
click() {
this.rootNode.$emit('click', this.model)
this.rootNode.$emit('click', {
toggle: this.toggle,
...this.model
})
},
addChild(isLeaf) {