From f91fef056e70cb299ea76642354139cb29ee3e27 Mon Sep 17 00:00:00 2001 From: Aylur Date: Tue, 7 May 2024 19:13:44 +0200 Subject: [PATCH] mention bindings in template strings --- src/content/docs/config/reactivity.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/content/docs/config/reactivity.md b/src/content/docs/config/reactivity.md index e62a7ae..2409aae 100644 --- a/src/content/docs/config/reactivity.md +++ b/src/content/docs/config/reactivity.md @@ -7,6 +7,24 @@ or setup a `hook`. A `Binding` is just an object that holds information for widget constructors to setup a listener. +:::caution +`Binding` is a regular JavaScript object, +it cannot be used in template strings + +```js +const label = Variable("hello") + +Label({ + // [Object object] world + label: `${label.bind()} world`, + + // hello world + label: label.bind().as(hello => `${hello} world`) +}) +``` + +::: + ## Property Bindings We can make a `Binding` from a Variable