Skip to content

`use` statement, refactor, fix

Compare
Choose a tag to compare
@Ethosa Ethosa released this 15 Jul 13:45
· 1036 commits to master since this release

Changelog ✨

  • use statement - keep your component exemplars in variables and work with it like with objects ✌
    var comp = use:
      component MyComponent(myArg = 100):
        "component slot"
        tDiv:
          ...
    echo comp.myArg.val
    buildHtml:
      component comp
      component MyComponent(myArg = 101)
  • elem statement (shortcut for document.getElementById) ✨
    <input id="myInput">
    echo elem(myInput).value
  • Built-in UI components 🎴 (compile with -d:enableUi)
    Docs
    Example:
    buildHtml:
      component Button:
        "Click me!"
      component Input(placeholder = "Edit text ...", label = "Edit text ...")
  • events in event handlers 🛠
    buildHtml:
      tInput:
        @input(ev):  # `ev` is just param name. It may be anything. Works with any built-in web event
          echo ev.data
  • Callable states available 🔥
    Before:
    self.state.val()()
    Now:
    self.state()
  • Fix CSS into component style 🌿