From 7eedf0fc632004eba9303e64de735828d307b835 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 4 Dec 2025 09:45:20 +0000 Subject: [PATCH] Document jqhtml attribute restrictions in CLAUDE.dist.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docs/CLAUDE.dist.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/CLAUDE.dist.md b/docs/CLAUDE.dist.md index 0945a88ca..9398c5dcf 100644 --- a/docs/CLAUDE.dist.md +++ b/docs/CLAUDE.dist.md @@ -650,6 +650,12 @@ async on_load() { - **`$quoted="string"`** → String literal - **`$unquoted=expression`** → JavaScript expression - **`$sid="name"`** → Scoped element ID +- **`attr="<%= expr %>"`** → HTML attribute with interpolation + +**Key restrictions:** +- **`` attributes are static** - No `<%= %>` on the `` tag. For dynamic attributes on the root element, use inline JS: `<% this.$.attr('data-id', this.args.id); %>` +- **`$prefix` = component args, NOT HTML attributes** - `` creates `this.args['data-id']`, not a `data-id` DOM attribute +- **Conditional attributes use if-statements** - `<% if (cond) { %>checked<% } %>` not ternaries ### Component Access