Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add boolean attributes #345

Merged
merged 3 commits into from
Sep 18, 2024
Merged

add boolean attributes #345

merged 3 commits into from
Sep 18, 2024

Conversation

Ethosa
Copy link
Contributor

@Ethosa Ethosa commented Sep 18, 2024

var isReadonly = remember true

appRoutes "app":
  "/":
    tInput(value = "hello world", readonly = isReadonly)
    tButton:
      "switch"
      @click:
        isReadonly.set(not isReadonly)

HappyX will render it as

<input value="hello world">

and if isReadonly wil be true

<input value="hello world" readonly>

Attributes can be named with -:

tButton(data-happyx-ok = "Hello from HappyX"):
  "Hello world"

will be rendered as

<button data-happyx-ok="Hello from HappyX">Hello world</button>

@Ethosa Ethosa merged commit 8af28de into master Sep 18, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant