import {onMounted, onUpdated, Teleport, watch, defineComponent, renderSlot, onBeforeUnmount, VNode, Ref} from 'vue'; import {useRef, useMountedState, useEffect, useState} from "./index"; const Content = defineComponent({ name: 'Content', props: { contentMounted: { type: Function, default: () => { } }, contentUpdated: { type: Function, default: () => { } }, }, emits: [ 'onContentMounted', 'onContentUpdated', ], setup(props, ctx) { onMounted(() => props.contentMounted()) onUpdated(() => props.contentUpdated()) return () => { // @ts-ignore const children = ctx.slots?.default(); return ( <> {children} > ) }; } }); // 参考:https://github.com/ryanseddon/react-frame-component export const Frame = { name: 'Frame', props: { mountTarget: { type: String }, contentMounted: { type: Function, default: () => { } }, contentUpdated: { type: Function, default: () => { } }, initialContent: { type: String, default: '
' } }, IntrinsicAttributes: true, setup(props, ctx) { const [node] = useState