Skip to content

Commit

Permalink
feat(comp:modal): add prop to control transition (#674)
Browse files Browse the repository at this point in the history
fix #623
  • Loading branch information
unknownzjc committed Dec 28, 2021
1 parent ee50524 commit 4b4d786
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/modal/docs/Index.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ order: 0
| `icon` | 自定义图标 | `string \| VNode \| #icon` | - ||`type` 不为 `default` 时有效 |
| `mask` | 是否展示蒙层 | `boolean` | `true` || - |
| `maskClosable` | 点击蒙层是否允许关闭 | `boolean` | `true` || - |
| `animatable` | 是否开启弹窗动画效果 | `boolean` | `true` | - | - |
| `offset` | 对话框偏移量 | `number \| string` | `128` | - | 为顶部偏移量,仅在`centered=false` 时生效 |
| `okButton` | 确认按钮的属性 | `ButtonProps` | - | - | - |
| `okText` | 确认按钮的文本 | `string` | `确定` | - | - |
Expand Down
2 changes: 1 addition & 1 deletion packages/components/modal/src/ModalWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default defineComponent({
onKeydown={onWrapperKeydown}
>
<Transition
name={`${common.prefixCls}-zoom`}
name={props.animatable ? `${common.prefixCls}-zoom` : undefined}
appear
onEnter={onEnter}
onAfterEnter={onAfterEnter}
Expand Down
1 change: 1 addition & 0 deletions packages/components/modal/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const modalProps = {
icon: IxPropTypes.oneOfType([String, IxPropTypes.vNode]),
mask: IxPropTypes.bool,
maskClosable: IxPropTypes.bool,
animatable: IxPropTypes.bool.def(true),
offset: IxPropTypes.oneOfType([String, Number]).def(128),
okButton: IxPropTypes.object<ButtonProps>(),
okText: IxPropTypes.string,
Expand Down

0 comments on commit 4b4d786

Please sign in to comment.