diff --git a/src/util/vue.tsx b/src/util/vue.tsx index 16bb826..3220770 100644 --- a/src/util/vue.tsx +++ b/src/util/vue.tsx @@ -214,39 +214,13 @@ export function processedPropType(...types: PropTypes[]): PropType { - const elementComponent = element[ComponentKey]; const isHovered = ref(false); - element[ComponentKey] = defineComponent({ - props: { - element: { - type: Object as PropType, - required: true - } - }, - setup: function (props) { - const element = toRef(props, "element"); - - onUnmounted(() => (isHovered.value = false)); - return () => ( -
(isHovered.value = true)} - onPointerleave={() => (isHovered.value = false)} - > - {/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */} - {unwrapRef(element) == null ? "" : renderJSX(unwrapRef(element)!)} -
- ); - } - }) as GenericComponent; - const elementGatherProps = element[GatherProps].bind(element); element[GatherProps] = () => ({ - element: { - [ComponentKey]: elementComponent, - [GatherProps]: elementGatherProps - } + ...elementGatherProps(), + onPointerenter: () => (isHovered.value = true), + onPointerleave: () => (isHovered.value = false) }); return isHovered;