Consider adding conditional attributes
matthewp opened this issue · comments
Matthew Phillips commented
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>