8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35785f3 commit 44a6b08Copy full SHA for 44a6b08
packages/runtime-core/src/vnode.ts
@@ -9,6 +9,7 @@ import {
9
isObject,
10
isOn,
11
isString,
12
+ isVoidTag,
13
normalizeClass,
14
normalizeStyle,
15
} from '@vue/shared'
@@ -618,6 +619,17 @@ function _createVNode(
618
619
? ShapeFlags.FUNCTIONAL_COMPONENT
620
: 0
621
622
+ if (
623
+ __DEV__ &&
624
+ shapeFlag & ShapeFlags.ELEMENT &&
625
+ isVoidTag(type as string) &&
626
+ children != null
627
+ ) {
628
+ warn(
629
+ `don't render child nodes in a self-closing tag <${type as string} />, it may cause unexpected behavior`,
630
+ )
631
+ }
632
+
633
if (__DEV__ && shapeFlag & ShapeFlags.STATEFUL_COMPONENT && isProxy(type)) {
634
type = toRaw(type)
635
warn(
0 commit comments