浏览代码

Add note to chain .toString() to keep false

David Leininger 4 年之前
父节点
当前提交
5f09c37d2f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      README.md

+ 2 - 0
README.md

@@ -293,6 +293,8 @@ This will add or remove the `disabled` attribute when `myVar` is true or false r
 
 Boolean attributes are supported as per the [HTML specification](https://html.spec.whatwg.org/multipage/indices.html#attributes-3:boolean-attribute), for example `disabled`, `readonly`, `required`, `checked`, `hidden`, `selected`, `open`, etc.
 
+> Note: If you need a false state to show for your attribute, such as `aria-*`, chain `.toString()` to the value while binding to the attribute. For example: `:aria-expanded="isOpen.toString()"` would persist whether  `isOpen` was `true` or `false`.
+
 **`.camel` modifier**
 **Example:** `<svg x-bind:view-box.camel="viewBox">`