fix(Popup): adjust teleport handler

This commit is contained in:
chenjiahan 2020-08-21 11:03:21 +08:00
parent 52b187692b
commit 54a8608078

View File

@ -1,6 +1,6 @@
// Utils // Utils
import { Teleport, Transition } from 'vue'; import { Teleport, Transition } from 'vue';
import { createNamespace, isDef, isFunction } from '../utils'; import { createNamespace, isDef } from '../utils';
import { on, off, preventDefault } from '../utils/dom/event'; import { on, off, preventDefault } from '../utils/dom/event';
import { getScroller } from '../utils/dom/scroll'; import { getScroller } from '../utils/dom/scroll';
@ -319,11 +319,9 @@ export default createComponent({
}, },
render() { render() {
const { teleport } = this; if (this.teleport) {
if (teleport) {
const to = isFunction(teleport) ? teleport() : teleport;
return ( return (
<Teleport to={to}> <Teleport to={this.teleport}>
{this.genOverlay()} {this.genOverlay()}
{this.genPopup()} {this.genPopup()}
</Teleport> </Teleport>