We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98995ee commit 6e25dc9Copy full SHA for 6e25dc9
packages/runtime/dom/dom.ts
@@ -10,7 +10,14 @@ import { camelToDash } from "../utils/others";
10
*
11
* @param node the vnode
12
*/
13
-export function createElement(node: VNode): Node {
+export function createElement(node: VNode | VNode[]): Node {
14
+ if (Array.isArray(node)) {
15
+ const fragment = document.createDocumentFragment();
16
+ for (const child of node) {
17
+ fragment.appendChild(createElement(child));
18
+ }
19
+ return fragment;
20
21
// create a dom node according to the tag name of the vnode
22
const el =
23
node.tagName === "Fragment"
0 commit comments