Feature: Added toggle() method to the node passed to TreeNode.click() handler.

pull/93/head
Barry Jones 2 years ago
parent 5500a36492
commit 0f04f7edba
  1. 2
      readme.md
  2. 5
      src/VueTreeList.vue

@ -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 |

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

Loading…
Cancel
Save