Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Overlay/Modal): 新增 Modal.show() 快速使用弹框功能,修复Overlay首次打开没有动画问题 (#746)
- Loading branch information
Showing
4 changed files
with
166 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import Modal, { ModalProps } from './'; | ||
|
||
export default function CallShow(props: Omit<ModalProps, 'onClosed' | 'isOpen'> & { children: React.ReactNode }) { | ||
const { title = '提示框', children, ...other } = props; | ||
const dv = document.createElement('div'); | ||
dv.id = 'uiw-modal-call-show-element'; | ||
document.body.appendChild(dv); | ||
ReactDOM.render( | ||
<Modal | ||
{...other} | ||
title={title} | ||
isOpen={true} | ||
onClosed={() => { | ||
document.getElementById('uiw-modal-call-show-element')!.remove(); | ||
}} | ||
> | ||
{children} | ||
</Modal>, | ||
document.getElementById('uiw-modal-call-show-element'), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters