import { onMount } from './lifecycle' ; import { getCurrentInstance } from '../runtime/instance' ; import { defineComponent } from './defineComponent' ; defineComponent ( { name : 'VPortal' , setup ( ) { const { el } = getCurrentInstance ( ) ; const $body = window . document . body ; const $slot = document . createElement ( 'slot' ) ; onMount ( ( ) => { if ( el . parentNode != $body ) { $body . appendChild ( el ) ; } } ) ; return ( ) => $slot ; } , } ) ;