Skip to content

Commit

Permalink
fix(vue-xrender): vue-xrender x-jsx component props type error in vue2
Browse files Browse the repository at this point in the history
  • Loading branch information
2214962083 committed Apr 21, 2022
1 parent e2f8d66 commit 47b057e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vue-xrender/src/components/x-jsx.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -23,12 +23,12 @@ const vm = defineComponent({
name: 'XJsx',
props: {
jsx: {
type: [Function, Object, Array, String, Number, Boolean] as PropType<JsxNode | JsxFn | FunctionComponent>
type: [Function, Object, Array, String, Number, Boolean]
}
},
render(): VNode {
const {$slots, $attrs, $props} = this as InstanceType<typeof vm>
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}
Expand Down

0 comments on commit 47b057e

Please sign in to comment.