matthewp / bram

Web components, live bound templates, in 4kB

Home Page:https://bramjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider adding conditional attributes

matthewp opened this issue · comments

Consider adding conditional attributes, something like:

<template>
  <div hidden?="{{isHidden}}"></div>
</template>

If isHidden is a boolean, treat hidden as a boolean attribute. If it is another truthy value, like a string, coerce it to a string and set that as the value.

Note that this should also work for property bindings like:

<template>
  <my-component :prop?="{{propVal}}"></my-component>
</template>