import Dialog from './Dialog'; import getDialogPropTypes from './IDialogPropTypes'; import { getListeners } from '../_util/props-util'; import Portal from '../_util/PortalWrapper'; const IDialogPropTypes = getDialogPropTypes(); const DialogWrap = { inheritAttrs: false, props: { ...IDialogPropTypes, visible: IDialogPropTypes.visible.def(false), }, render() { const { visible, getContainer, forceRender } = this.$props; const dialogProps = { props: this.$props, attrs: this.$attrs, ref: '_component', key: 'dialog', on: getListeners(this), }; // 渲染在当前 dom 里; if (getContainer === false) { return ( 2} // 不对 body 做任何操作。。 > {this.$slots.default} ); } return ( { dialogProps.props = { ...dialogProps.props, ...childProps }; return {this.$slots.default}; }} /> ); }, }; export default DialogWrap;