Select: add popper-append-to-body (#9782)

pull/9607/merge
杨奕 2018-02-11 18:18:49 +08:00 committed by GitHub
parent b070c8d88c
commit 0f06fd5079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 1 deletions

View File

@ -212,6 +212,7 @@ Currently Element ships with the following languages:
<li>Kazakh (kz)</li>
<li>Hungarian (hu)</li>
<li>Romanian (ro)</li>
<li>Kurdish (ku)</li>
</ul>
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/dev/src/locale/lang) and create a pull request.

View File

@ -684,6 +684,7 @@ If the binding value of Select is an object, make sure to assign `value-key` as
| popper-class | custom class name for Select's dropdown | string | — | — |
| reserve-keyword | when `multiple` and `filter` is true, whether to reserve current keyword after selecting an option | boolean | — | false |
| default-first-option | select first matching option on enter key. Use with `filterable` or `remote` | boolean | - | false |
| popper-append-to-body| whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true |
### Select Events
| Event Name | Description | Parameters |

View File

@ -212,6 +212,7 @@ Actualmente Element está disponible en los siguientes idiomas:
<li>Kazakh (kz)</li>
<li>Hungarian (hu)</li>
<li>Romanian (ro)</li>
<li>Kurdish (ku)</li>
</ul>
Si su idioma de destino no está incluido, puede contribuir: simplemente añada [aqui](https://github.com/ElemeFE/element/tree/dev/src/locale/lang) otra configuración de idioma y cree un pull request.

View File

@ -690,6 +690,7 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va
| popper-class | nombre de clase personalizado para el menú desplegable del Select | string | — | — |
| reserve-keyword | cuando `multiple` y `filter` es `true`, si se debe reservar la palabra clave actual después de seleccionar una opción. | boolean | — | false |
| default-first-option | seleccione la primera opción de coincidencia en la tecla enter. Uso con `filterable` o `remote`. | boolean | - | false |
| popper-append-to-body| whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true |
### Eventos Select
| Nombre | Descripción | Parametros |

View File

@ -224,6 +224,7 @@ ElementLocale.i18n((key, value) => i18n.t(key, value))
<li>哈萨克斯坦语kz</li>
<li>匈牙利语hu</li>
<li>罗马尼亚语ro</li>
<li>库尔德语ku</li>
</ul>
如果你需要使用其他的语言,欢迎贡献 PR只需在 [这里](https://github.com/ElemeFE/element/tree/dev/src/locale/lang) 添加一个语言配置文件即可。

View File

@ -679,6 +679,7 @@
| popper-class | Select 下拉框的类名 | string | — | — |
| reserve-keyword | 多选且可搜索时,是否在选中一个选项后保留当前的搜索关键词 | boolean | — | false |
| default-first-option | 在输入框按下回车,选择第一个匹配项。需配合 `filterable``remote` 使用 | boolean | - | false |
| popper-append-to-body | 是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false | boolean | - | true |
### Select Events
| 事件名称 | 说明 | 回调参数 |

View File

@ -36,6 +36,11 @@
visibleArrow: {
default: true
},
appendToBody: {
type: Boolean,
default: true
}
},

View File

@ -100,6 +100,7 @@
@after-leave="doDestroy">
<el-select-menu
ref="popper"
:append-to-body="popperAppendToBody"
v-show="visible && emptyText !== false">
<el-scrollbar
tag="ul"
@ -273,7 +274,11 @@
type: String,
default: 'value'
},
collapseTags: Boolean
collapseTags: Boolean,
popperAppendToBody: {
type: Boolean,
default: true
}
},
data() {

View File

@ -141,4 +141,8 @@
}
}
}
.el-select-dropdown__wrap {
margin-bottom: 0 !important;
}
}