diff --git a/examples/docs/en-US/tree.md b/examples/docs/en-US/tree.md index bab9dfe15..7fded6746 100644 --- a/examples/docs/en-US/tree.md +++ b/examples/docs/en-US/tree.md @@ -1184,6 +1184,7 @@ You can drag and drop Tree nodes by adding a `draggable` attribute. | filter-node-method | this function will be executed on each node when use filter method. if return `false`, tree node will be hidden. | Function(value, data, node) | — | — | | accordion | whether only one node among the same level can be expanded at one time | boolean | — | false | | indent | horizontal indentation of nodes in adjacent levels in pixels | number | — | 16 | +| icon-class | custome tree node icon | string | - | - | | lazy | whether to lazy load leaf node, used with `load` attribute | boolean | — | false | | draggable | whether enable tree nodes drag and drop | boolean | — | false | | allow-drag | this function will be executed before dragging a node. If `false` is returned, the node can not be dragged | Function(node) | — | — | diff --git a/examples/docs/es/tree.md b/examples/docs/es/tree.md index 8c91bb268..ded4534ba 100644 --- a/examples/docs/es/tree.md +++ b/examples/docs/es/tree.md @@ -1184,6 +1184,8 @@ Puede arrastrar y soltar nodos de Tree añadiendo un atributo `draggable` . | filter-node-method | Esta función se ejecutará en cada nodo cuando se use el método filtrtar, si devuelve `false` el nodo se oculta | Function(value, data, node) | — | — | | accordion | Si solo un nodo de cada nivel puede expandirse a la vez | boolean | — | false | | indent | Indentación horizontal de los nodos en niveles adyacentes, en pixeles | number | — | 16 | +| icon-class | Custome tree node icon | string | - | - | +| lazy | whether to lazy load leaf node, used with `load` attribute | boolean | — | false | | draggable | si se habilita la función de drag and drop en los nodos | boolean | — | false | | allow-drag | esta función se ejecutará antes de arrastrar un nodo. si devuelve `false`, el nodo no puede ser arrastrado. | Function(nodo) | — | — | | allow-drop | esta función se ejecutará al arrastrar y soltar un nodo. si devuelve false, el nodo arrastrando no se puede soltar en el nodo destino. `type` tiene tres valores posibles: 'prev' (insertar el nodo de arrastre antes del nodo de destino), 'inner' (insertar el nodo de arrastre en el nodo de destino) y 'next' (insertar el nodo de arrastre después del nodo de destino) | Function(Nodoquesearrastra, Nododestino, type) | — | — | diff --git a/examples/docs/zh-CN/tree.md b/examples/docs/zh-CN/tree.md index ed01238c5..6fd481d82 100644 --- a/examples/docs/zh-CN/tree.md +++ b/examples/docs/zh-CN/tree.md @@ -1203,6 +1203,7 @@ | filter-node-method | 对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏 | Function(value, data, node) | — | — | | accordion | 是否每次只打开一个同级树节点展开 | boolean | — | false | | indent | 相邻级节点间的水平缩进,单位为像素 | number | — | 16 | +| icon-class | 自定义树节点的图标 | string | - | - | | lazy | 是否懒加载子节点,需与 load 方法结合使用 | boolean | — | false | | draggable | 是否开启拖拽节点功能 | boolean | — | false | | allow-drag | 判断节点能否被拖拽 | Function(node) | — | — | diff --git a/packages/tree/src/model/node.js b/packages/tree/src/model/node.js index f8e58d7e0..85ffa388b 100644 --- a/packages/tree/src/model/node.js +++ b/packages/tree/src/model/node.js @@ -156,10 +156,6 @@ export default class Node { return getPropertyFromData(this, 'label'); } - get icon() { - return getPropertyFromData(this, 'icon'); - } - get key() { const nodeKey = this.store.key; if (this.data) return this.data[nodeKey]; diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index c1e00113c..b77c5697f 100644 --- a/packages/tree/src/tree-node.vue +++ b/packages/tree/src/tree-node.vue @@ -26,9 +26,13 @@