소스 검색

Tree: update doc and definition file (#13540)

hetech 6 년 전
부모
커밋
dd4a496940
4개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      examples/docs/en-US/tree.md
  2. 1 1
      examples/docs/es/tree.md
  3. 1 1
      examples/docs/zh-CN/tree.md
  4. 2 1
      types/tree.d.ts

+ 1 - 1
examples/docs/en-US/tree.md

@@ -1213,7 +1213,7 @@ You can drag and drop Tree nodes by adding a `draggable` attribute.
 | getHalfCheckedNodes | If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of nodes | - |
 | getHalfCheckedKeys | If the node can be selected (`show-checkbox` is `true`), it returns the currently half selected array of node's keys | - |
 | getCurrentKey   | return the highlight node's key (null if no node is highlighted) | — |
-| getCurrentNode  | return the highlight node (null if no node is highlighted) | — |
+| getCurrentNode  | return the highlight node's data (null if no node is highlighted) | — |
 | setCurrentKey   | set highlighted node by key, only works when `node-key` is assigned | (key) the node's key to be highlighted. If `null`, cancel the currently highlighted node |
 | setCurrentNode  | set highlighted node, only works when `node-key` is assigned | (node) the node to be highlighted |
 | getNode         | get node by data or key | (data) the node's data or key |

+ 1 - 1
examples/docs/es/tree.md

@@ -1212,7 +1212,7 @@ Puede arrastrar y soltar nodos de Tree añadiendo un atributo `draggable` .
 | getHalfCheckedNodes | Si el nodo puede ser seleccionado (`show-checkbox` es `true`), devuelve la mitad del array de nodos actualmente seleccionada. | - |
 | getHalfCheckedKeys | Si el nodo puede ser seleccionado (`show-checkbox` es `true`), devuelve la mitad del array de claves del nodo actualmente seleccionado. | - |
 | getCurrentKey     | devuelve la clave del nodo resaltado actualmente (null si no hay ninguno) | —                                        |
-| getCurrentNode    | devuelve el nodo resaltado (null si no hay ninguno) | —                                        |
+| getCurrentNode    | return the highlight node's data (null if no node is highlighted)         | —                                        |
 | setCurrentKey     | establece el nodo resaltado por la clave, solo funciona si `node-key` está asignado | (key) la clave del nodo a ser resaltado. If `null`, cancel the currently highlighted node  |
 | setCurrentNode    | establece el nodo resaltado, solo funciona si `node-key` está asignado | (node) nodo a ser resaltado              |
 | getNode         | devuelve el nodo por el dato o la clave | (data) los datos o clave del nodo |

+ 1 - 1
examples/docs/zh-CN/tree.md

@@ -1234,7 +1234,7 @@
 | getHalfCheckedNodes | 若节点可被选择(即 `show-checkbox` 为 `true`),则返回目前半选中的节点所组成的数组  | - |
 | getHalfCheckedKeys | 若节点可被选择(即 `show-checkbox` 为 `true`),则返回目前半选中的节点的 key 所组成的数组 | - |
 | getCurrentKey   | 获取当前被选中节点的 key,使用此方法必须设置 node-key 属性,若没有节点被选中则返回 null | — |
-| getCurrentNode  | 获取当前被选中节点的 node,若没有节点被选中则返回 null | — |
+| getCurrentNode  | 获取当前被选中节点的 data,若没有节点被选中则返回 null | — |
 | setCurrentKey   | 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 | (key) 待被选节点的 key,若为 null 则取消当前高亮的节点 |
 | setCurrentNode  | 通过 node 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 | (node) 待被选节点的 node |
 | getNode         | 根据 data 或者 key 拿到 Tree 组件中的 node | (data) 要获得 node 的 key 或者 data |

+ 2 - 1
types/tree.d.ts

@@ -209,7 +209,8 @@ export declare class ElTree<K = any, D = TreeData> extends ElementUIComponent {
   setCurrentKey(key: K): void;
 
   /**
-   * Return the highlight node (null if no node is highlighted)
+   * Return the highlight node data (null if no node is highlighted)
+   * @todo the name of methods should be getCurrentNodeData
    */
   getCurrentNode(): D;