From 47b057ea8f6d74686dbea861e88bb66ee4f9cac0 Mon Sep 17 00:00:00 2001 From: 2214962083 <2214962083@qq.com> Date: Fri, 22 Apr 2022 07:19:15 +0800 Subject: [PATCH] fix(vue-xrender): vue-xrender x-jsx component props type error in vue2 --- packages/vue-xrender/src/components/x-jsx.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vue-xrender/src/components/x-jsx.ts b/packages/vue-xrender/src/components/x-jsx.ts index 4ca5cf7..e88d812 100644 --- a/packages/vue-xrender/src/components/x-jsx.ts +++ b/packages/vue-xrender/src/components/x-jsx.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import {FunctionComponent, JsxFn, JsxNode} from '@/utils/types-helper' -import {defineComponent, VNode, h, PropType} from 'vue-demi' +import {defineComponent, VNode, h} from 'vue-demi' const valueIsFunctionComponent = (value: any): value is FunctionComponent => { return typeof value === 'object' && value.functional && typeof value.render === 'function' @@ -23,12 +23,12 @@ const vm = defineComponent({ name: 'XJsx', props: { jsx: { - type: [Function, Object, Array, String, Number, Boolean] as PropType + type: [Function, Object, Array, String, Number, Boolean] } }, render(): VNode { const {$slots, $attrs, $props} = this as InstanceType - const {jsx} = $props + const jsx = $props.jsx as JsxNode | JsxFn | FunctionComponent const children = typeof $slots.default === 'function' ? $slots.default() : $slots.default const props = {...$attrs, children}