export function render(_ctx) {
const _component_Comp = _resolveComponent("Comp")
- const n3 = t0(1)
+ const n3 = t0(); n3.$dp = 1;
const n1 = _child(n3)
_setInsertionState(n1)
const n0 = _createSlot("default", null)
dynamic
if (id !== undefined && template !== undefined) {
- push(NEWLINE, `const n${id} = t${template}(${dynamicChildOffset || ''})`)
+ push(NEWLINE, `const n${id} = t${template}()`)
+ if (dynamicChildOffset) push(`; n${id}.$dp = ${dynamicChildOffset};`)
push(...genDirectivesForElement(id, context))
}
}
}
+ if (child.dynamicChildOffset) {
+ pushBlock(`; ${variable}.$dp = ${child.dynamicChildOffset};`)
+ }
+
if (id === child.anchor && !child.hasDynamicChild) {
push(...genSelf(child, context))
}
/*! #__NO_SIDE_EFFECTS__ */
export function template(html: string, root?: boolean) {
let node: Node
- return (n?: number): Node & { $root?: true } => {
+ return (): Node & { $root?: true } => {
if (isHydrating) {
if (__DEV__ && !currentHydrationNode) {
// TODO this should not happen
throw new Error('No current hydration node')
}
node = adoptTemplate(currentHydrationNode!, html)!
- // dynamic node position, default is 0
- ;(node as any).$dp = n || 0
if (root) (node as any).$root = true
return node
}