From 3bc67fa57528550db85ef2e0f4e8c60fb6d1157a Mon Sep 17 00:00:00 2001 From: FuryBean Date: Tue, 6 Feb 2018 11:42:01 +0800 Subject: [PATCH] Tree: add node-contextmenu event for tree node (#9678) --- examples/docs/en-US/tree.md | 1 + examples/docs/es/tree.md | 1 + examples/docs/zh-CN/tree.md | 1 + packages/tree/src/tree-node.vue | 5 +++++ 4 files changed, 8 insertions(+) diff --git a/examples/docs/en-US/tree.md b/examples/docs/en-US/tree.md index 6b4ca4dd..ed8002a7 100644 --- a/examples/docs/en-US/tree.md +++ b/examples/docs/en-US/tree.md @@ -981,6 +981,7 @@ Only one node among the same level can be expanded at one time. | Event Name | Description | Parameters | | -------------- | ---------------------------------------- | ---------------------------------------- | | node-click | triggers when a node is clicked | three parameters: node object corresponding to the node clicked, `node` property of TreeNode, TreeNode itself | +| node-contextmenu | triggers when a node is clicked by right button | four parameters: event, node object corresponding to the node clicked, `node` property of TreeNode, TreeNode itself | | check-change | triggers when the selected state of the node changes | three parameters: node object corresponding to the node whose selected state is changed, whether the node is selected, whether node's subtree has selected nodes | | current-change | triggers when current node changes | two parameters: node object corresponding to the current node, `node` property of TreeNode | | node-expand | triggers when current node open | three parameters: node object corresponding to the node opened, `node` property of TreeNode, TreeNode itself | diff --git a/examples/docs/es/tree.md b/examples/docs/es/tree.md index 8cbe6ce9..31be8d8b 100644 --- a/examples/docs/es/tree.md +++ b/examples/docs/es/tree.md @@ -979,6 +979,7 @@ Solo puede ser expandido un nodo del mismo nivel a la vez. | Nombre del evento | Descripción | Parámetros | | ----------------- | ---------------------------------------- | ---------------------------------------- | | node-click | se lanza cuando un nodo es pinchado | tres parámetros: el objeto del nodo seleccionado, propiedad `node` de TreeNode y el TreeNode en si | +| node-contextmenu | triggers when a node is clicked by right button | four parameters: event, node object corresponding to the node clicked, `node` property of TreeNode, TreeNode itself | | check-change | se lanza cuando el estado de selección del nodo cambia | tres parámetros: objeto nodo que se corresponde con el que ha cambiado, booleano que dice si esta seleccionado, booleano que dice si el nodo tiene hijos seleccionados | | current-change | cambia cuando el nodo actual cambia | dos parámetros: objeto nodo que se corresponde al nodo actual y propiedad `node` del TreeNode | | node-expand | se lanza cuando el nodo actual se abre | tres parámetros: el objeto del nodo abierto, propiedad `node` de TreeNode y el TreeNode en si | diff --git a/examples/docs/zh-CN/tree.md b/examples/docs/zh-CN/tree.md index 66aacf58..d2aeb382 100644 --- a/examples/docs/zh-CN/tree.md +++ b/examples/docs/zh-CN/tree.md @@ -980,6 +980,7 @@ | 事件名称 | 说明 | 回调参数 | | -------------- | -------------- | ---------------------------------------- | | node-click | 节点被点击时的回调 | 共三个参数,依次为:传递给 `data` 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。 | +| node-contextmenu | 当某一节点被鼠标右键点击时会触发该事件 | 共四个参数,依次为:event、传递给 `data` 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。 | | check-change | 节点选中状态发生变化时的回调 | 共三个参数,依次为:传递给 `data` 属性的数组中该节点所对应的对象、节点本身是否被选中、节点的子树中是否有被选中的节点 | | current-change | 当前选中节点变化时触发的事件 | 共两个参数,依次为:当前节点的数据,当前节点的 Node 对象 | | node-expand | 节点被展开时触发的事件 | 共三个参数,依次为:传递给 `data` 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。 | diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index d3393bf9..d9f74b11 100644 --- a/packages/tree/src/tree-node.vue +++ b/packages/tree/src/tree-node.vue @@ -2,6 +2,7 @@