fix(modal): on-after-enter prop not working

This commit is contained in:
07akioni 2021-10-12 03:17:34 +08:00
parent 1b6fe1427d
commit e7bbcf410f
4 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@
- Fix `n-ellipisis`'s `expand-trigger` prop not show `pointer` cursor when content is shortcloses [#1299](https://github.com/TuSimple/naive-ui/issues/1299).
- Fix `n-select`'s `fallback-option` prop's type, closes [#1327](https://github.com/TuSimple/naive-ui/issues/1327).
- Fix `n-modal`'s `on-after-enter` prop not working.
## 2.19.6 (2021-10-10)

View File

@ -6,6 +6,7 @@
- 修复 `n-ellipisis``expand-trigger` 属性在内容不显示提示的时候禁用鼠标样式的问题,关闭 [#1299](https://github.com/TuSimple/naive-ui/issues/1299)
- 修复 `n-select` `fallback-option` 属性类型,关闭 [#1327](https://github.com/TuSimple/naive-ui/issues/1327)
- 修复 `n-modal` `on-after-enter` 不生效
## 2.19.6 (2021-10-10)

View File

@ -66,7 +66,8 @@ export default defineComponent({
onClose: {
type: Function,
required: true
}
},
onAfterEnter: Function as PropType<() => void>
},
setup (props) {
const bodyRef = ref<HTMLElement | ComponentPublicInstance | null>(null)
@ -198,6 +199,7 @@ export default defineComponent({
name="fade-in-scale-up-transition"
appear={this.appear ?? this.isMounted}
onEnter={handleEnter as any}
onAfterEnter={this.onAfterEnter}
onAfterLeave={handleAfterLeave}
onBeforeLeave={handleBeforeLeave as any}
>

View File

@ -51,6 +51,7 @@ const modalProps = {
onUpdateShow: [Function, Array] as PropType<
MaybeArray<(value: boolean) => void>
>,
onAfterEnter: Function as PropType<() => void>,
onBeforeLeave: Function as PropType<() => void>,
onAfterLeave: Function as PropType<() => void>,
onClose: Function as PropType<() => Promise<boolean> | boolean | any>,
@ -269,6 +270,7 @@ export default defineComponent({
onNegativeClick={this.handleNegativeClick}
onPositiveClick={this.handlePositiveClick}
onBeforeLeave={this.handleBeforeLeave}
onAfterEnter={this.onAfterEnter}
onAfterLeave={this.handleAfterLeave}
onClickoutside={this.handleClickoutside}
>