mirror of https://github.com/ElemeFE/element
Tree: add filter-check-strictly property
parent
5390f4069e
commit
dab6b9dae0
|
@ -811,7 +811,7 @@ You can drag and drop Tree nodes by adding a `draggable` attribute.
|
|||
| 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) | — | — |
|
||||
| allow-drop | this function will be executed before the dragging node is dropped. If `false` is returned, the dragging node can not be dropped at the target node. `type` has three possible values: 'prev' (inserting the dragging node before the target node), 'inner' (inserting the dragging node to the target node) and 'next' (inserting the dragging node after the target node) | Function(draggingNode, dropNode, type) | — | — |
|
||||
|
||||
| filter-check-strictly | Whether to check the parent time only check the filtered child when `show-checkbox` is `true` | boolean | — | false |
|
||||
### props
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
| --------- | ---------------------------------------- | ------ | --------------- | ------- |
|
||||
|
|
|
@ -811,7 +811,7 @@ Puede arrastrar y soltar nodos de Tree añadiendo un atributo `draggable` .
|
|||
| draggable | si se habilita la función de drag & 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) | — | — |
|
||||
|
||||
| filter-check-strictly | Whether to check the parent time only check the filtered child when `show-checkbox` is `true` | boolean | — | false |
|
||||
### props
|
||||
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
|
||||
| -------- | ---------------------------------------- | ----------------------------- | ----------------- | ----------- |
|
||||
|
|
|
@ -815,7 +815,7 @@ Vous pouvez déplacer les noeuds par drag'n drop en ajoutant l'attribut `draggab
|
|||
| draggable | Si les noeuds sont déplaçables par drag'n drop. | boolean | — | false |
|
||||
| allow-drag | Fonction exécutée avant le déplacement d'un noeud. Si `false` est retourné, le noeud ne sera pas déplaçable. | Function(node) | — | — |
|
||||
| allow-drop | Fonction exécutée avant le placement d'un noeud. Si `false` est retourné, le noeud ne pourra être placé sur la zone en question. `type` a trois valeurs possibles: 'prev' (insertion avant le noeud cible), 'inner' (insertion dans le noeud cible) and 'next' (insertion après le noeud cible). | Function(draggingNode, dropNode, type) | — | — |
|
||||
|
||||
| filter-check-strictly | Whether to check the parent time only check the filtered child when `show-checkbox` is `true` | boolean | — | false |
|
||||
### props
|
||||
|
||||
| Attribut | Description | Type | Valeurs acceptées | Défaut |
|
||||
|
|
|
@ -820,7 +820,7 @@
|
|||
| draggable | 是否开启拖拽节点功能 | boolean | — | false |
|
||||
| allow-drag | 判断节点能否被拖拽 | Function(node) | — | — |
|
||||
| allow-drop | 拖拽时判定目标节点能否被放置。`type` 参数有三种情况:'prev'、'inner' 和 'next',分别表示放置在目标节点前、插入至目标节点和放置在目标节点后 | Function(draggingNode, dropNode, type) | — | — |
|
||||
|
||||
| filter-check-strictly | 在显示复选框且处于筛选状态下,选择父级是否只勾选筛选结果的子级 | boolean | — | false |
|
||||
### props
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
| -------- | ----------------- | ------ | ---- | ---- |
|
||||
|
|
|
@ -355,6 +355,9 @@ export default class Node {
|
|||
|
||||
setChecked(value, deep, recursion, passValue) {
|
||||
this.indeterminate = value === 'half';
|
||||
|
||||
if (this.store.filterCheckStrictly && !this.visible) return;
|
||||
|
||||
this.checked = value === true;
|
||||
|
||||
if (this.store.checkStrictly) return;
|
||||
|
|
|
@ -128,7 +128,8 @@
|
|||
type: Number,
|
||||
default: 18
|
||||
},
|
||||
iconClass: String
|
||||
iconClass: String,
|
||||
filterCheckStrictly: Boolean
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
@ -173,6 +174,10 @@
|
|||
|
||||
checkStrictly(newVal) {
|
||||
this.store.checkStrictly = newVal;
|
||||
},
|
||||
|
||||
filterCheckStrictly(newVal) {
|
||||
this.store.filterCheckStrictly = newVal;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -330,6 +335,7 @@
|
|||
load: this.load,
|
||||
currentNodeKey: this.currentNodeKey,
|
||||
checkStrictly: this.checkStrictly,
|
||||
filterCheckStrictly: this.filterCheckStrictly,
|
||||
checkDescendants: this.checkDescendants,
|
||||
defaultCheckedKeys: this.defaultCheckedKeys,
|
||||
defaultExpandedKeys: this.defaultExpandedKeys,
|
||||
|
|
Loading…
Reference in New Issue