支持弹框里面放 page 的情况

This commit is contained in:
2betop 2020-06-17 12:14:05 +08:00
parent 6cf3347055
commit 6dfa4890ea
2 changed files with 21 additions and 3 deletions

View File

@ -408,7 +408,7 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
<div className={cx('Modal-header', headerClassName)}>
{showCloseButton !== false && !store.loading ? (
<a
data-tooltip={__('关闭弹窗')}
data-tooltip={__('关闭')}
data-position="left"
onClick={this.handleSelfClose}
className={cx('Modal-close')}
@ -424,7 +424,7 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
<div className={cx('Modal-header', headerClassName)}>
{showCloseButton !== false && !store.loading ? (
<a
data-tooltip={__('关闭弹窗')}
data-tooltip={__('关闭')}
onClick={this.handleSelfClose}
className={cx('Modal-close')}
>
@ -437,7 +437,7 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
</div>
) : showCloseButton !== false && !store.loading ? (
<a
data-tooltip={__('关闭弹窗')}
data-tooltip={__('关闭')}
onClick={this.handleSelfClose}
className={cx('Modal-close')}
>
@ -548,6 +548,15 @@ export class DialogRenderer extends Dialog {
}
if (!targets.length) {
const page = findLast(
components,
component => component.props.type === 'page'
);
if (page) {
components.push(...page.context.getComponents());
}
const form = findLast(
components,
component => component.props.type === 'form'

View File

@ -574,6 +574,15 @@ export class DrawerRenderer extends Drawer {
}
if (!targets.length) {
const page = findLast(
components,
component => component.props.type === 'page'
);
if (page) {
components.push(...page.context.getComponents());
}
const form = findLast(
components,
component => component.props.type === 'form'