Skip to content

Commit 25dbcee

Browse files
committed
chore: use child in template
1 parent 4b72fa6 commit 25dbcee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-vapor/src/dom/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isHydrating } from './hydration'
2-
import { createTextNode } from './node'
2+
import { child, createTextNode } from './node'
33
import { NodeRef, type VaporNode } from './nodeDraft'
44

55
let t: HTMLTemplateElement
@@ -18,7 +18,7 @@ export function template(html: string, root?: boolean) {
1818
if (!node) {
1919
t = t || document.createElement('template')
2020
t.innerHTML = html
21-
node = t.content.firstChild!
21+
node = child(t) as Node
2222
}
2323
const ret = node.cloneNode(true)
2424
if (root) (ret as any).$root = true

0 commit comments

Comments
 (0)