mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 03:18:16 +08:00
支持弹框里面放 page 的情况
This commit is contained in:
parent
6cf3347055
commit
6dfa4890ea
@ -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'
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user