mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-07 04:59:46 +08:00
feat(NumberKeyboard): add get-container prop (#6870)
This commit is contained in:
parent
08a554c5a2
commit
2328983afa
@ -6,7 +6,7 @@ function getElement(selector) {
|
||||
return selector();
|
||||
}
|
||||
|
||||
export function PortalMixin({ ref, afterPortal }) {
|
||||
export function PortalMixin({ ref, afterPortal } = {}) {
|
||||
return {
|
||||
props: {
|
||||
getContainer: [String, Function],
|
||||
|
@ -160,6 +160,7 @@ export default {
|
||||
| close-button-loading `v2.7.0` | Whether to show loading close button in custom theme | _boolean_ | `false` |
|
||||
| show-delete-key `v2.5.9` | Whether to show delete button | _boolean_ | `true` |
|
||||
| hide-on-click-outside | Whether to hide keyboard when click outside | _boolean_ | `true` |
|
||||
| get-container `v2.10.0` | Return the mount node for NumberKeyboard | _string \| () => Element_ | - |
|
||||
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
|
||||
|
||||
### Events
|
||||
|
@ -173,6 +173,7 @@ export default {
|
||||
| close-button-loading `v2.7.0` | 是否将关闭按钮设置为加载中状态,仅在 `theme="custom"` 时有效 | _boolean_ | `false` |
|
||||
| show-delete-key `v2.5.9` | 是否展示删除图标 | _boolean_ | `true` |
|
||||
| hide-on-click-outside | 点击外部时是否收起键盘 | _boolean_ | `true` |
|
||||
| get-container `v2.10.0` | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| () => Element_ | - |
|
||||
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
|
||||
|
||||
### Events
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { createNamespace } from '../utils';
|
||||
import { stopPropagation } from '../utils/dom/event';
|
||||
import { PortalMixin } from '../mixins/portal';
|
||||
import { BindEventMixin } from '../mixins/bind-event';
|
||||
import Key from './Key';
|
||||
|
||||
@ -7,6 +8,7 @@ const [createComponent, bem] = createNamespace('number-keyboard');
|
||||
|
||||
export default createComponent({
|
||||
mixins: [
|
||||
PortalMixin(),
|
||||
BindEventMixin(function (bind) {
|
||||
if (this.hideOnClickOutside) {
|
||||
bind(document.body, 'touchstart', this.onBlur);
|
||||
|
Loading…
x
Reference in New Issue
Block a user