diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index 3bf405e0..a19f0a74 100644 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -364,12 +364,18 @@ wrnexus build
app/pages{count} }
style { button { padding: 12px; } }
}`)}
- State is scoped to the nearest generated data-scope. Text expressions update reactively after hydration.
${escape(`state count = 0
+ State and interpolation
State is scoped to the nearest generated data-scope. Text and ordinary attribute expressions update reactively after hydration while retaining useful initial SSR values.
${escape(`state count = 0
state user = { name: "Ada" }
+state showPassword = false
view {
Count: {count}
{user.name}
+
+
}`)}
Events
Any DOM event can use @event="statement". The compiler emits data-on-event. The expression receives event and can mutate state.
Syntax Purpose @clickPointer or keyboard activation. @inputRead live field values. @changeReact to committed field changes. @submitHandle form submission behavior. @browser-clickRun only in a browser target. @mobile-clickRun only in a native/mobile target.
${escape(`