Skip to content
Darkmown 2.7

State inside a closed branch

A closed :if branch lives in a <template>, and querySelectorAll does not look inside one. Anything declared in there was therefore never hydrated: it started undefined, ignored its persist token, and stayed that way for the life of the page. Now the runtime re-claims seed scripts whenever a render changes structure, so a branch that opens brings its declarations with it.

Open the panel

The panel is closed. Everything inside it, including its :state, is still in a <template>.

The rules

Read the docs on reactive directives