diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index b007dfb..5ce3b7d 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -1,4 +1,10 @@ -import { isArray, isFunction, isString, ShapeFlags } from '@vue/shared' +import { + isArray, + isFunction, + isObject, + isString, + ShapeFlags +} from '@vue/shared' export interface VNode { __v_isVNode: true @@ -11,7 +17,11 @@ export function isVNode(value): value is VNode { return value ? value.__v_isVNode === true : false } export function createVNode(type, props, children): VNode { - const shapeFlag = isString(type) ? ShapeFlags.ELEMENT : 0 + const shapeFlag = isString(type) + ? ShapeFlags.ELEMENT + : isObject(type) + ? ShapeFlags.STATEFUL_COMPONENT + : 0 return createBaseVNode(type, props, children, shapeFlag) } diff --git a/packages/vue/examples/runtime/h-component-video-test.html b/packages/vue/examples/runtime/h-component-video-test.html new file mode 100644 index 0000000..f3de7f0 --- /dev/null +++ b/packages/vue/examples/runtime/h-component-video-test.html @@ -0,0 +1,38 @@ + + + + + Document + + + +
+ + + \ No newline at end of file diff --git a/packages/vue/examples/runtime/h-component.html b/packages/vue/examples/runtime/h-component.html index f3de7f0..bd425bb 100644 --- a/packages/vue/examples/runtime/h-component.html +++ b/packages/vue/examples/runtime/h-component.html @@ -9,30 +9,16 @@
\ No newline at end of file