Cascader: add visible-change event (#13415)

pull/13432/head
hetech 2018-11-14 12:25:41 +08:00 committed by GitHub
parent 026558682c
commit c1b869d7ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 3 deletions

View File

@ -1697,3 +1697,4 @@ Search and select options with a keyword.
| active-item-change | triggers when active option of its parent changes, only works when `change-on-select` is `false` | an array of active options |
| blur | triggers when Cascader blurs | (event: Event) |
| focus | triggers when Cascader focuses | (event: Event) |
| visible-change | triggers when the dropdown appears/disappears | true when it appears, and false otherwise |

View File

@ -1702,4 +1702,5 @@ Buscar y seleccionar opciones con una palabra clave.
| active-item-change | se dispara cuando la opcion activa del parent cambia, sólo funciona cuando `change-on-select` es `false`. | array de opciones activas |
| blur | se dispara cuando Cascader pierde el foco | (event: Event) |
| focus | se dispara cuando Cascader obtiene el foco | (event: Event) |
| visible-change | se dispara cuando el menu desplegable aparece o desaparece | true cuando aparece, y false en otro caso |

View File

@ -1697,3 +1697,4 @@
| active-item-change | 当父级选项变化时触发的事件,仅在 `change-on-select``false` 时可用 | 各父级选项组成的数组 |
| blur | 在 Cascader 失去焦点时触发 | (event: Event) |
| focus | 在 Cascader 获得焦点时触发 | (event: Event) |
| visible-change | 下拉框出现/隐藏时触发 | 出现则为 true隐藏则为 false |

View File

@ -165,6 +165,6 @@
### Step Slot
| name | 说明 |
|----|----|
| icon | 图标 |
| title | 标题 |
| description | 描述性文字 |
| icon | 自定义图标 |
| title | 自定义标题 |
| description | 自定义描述性文字 |

View File

@ -231,6 +231,7 @@ export default {
menuVisible(value) {
this.$refs.input.$refs.input.setAttribute('aria-expanded', value);
value ? this.showMenu() : this.hideMenu();
this.$emit('visible-change', value);
},
value(value) {
this.currentValue = value;