Browse Source

Merge pull request #789 from davidleininger/docs-update-x-bind

Docs: Add note to chain .toString() to persist  false
Caleb Porzio 4 years ago
parent
commit
217b5b71a9
1 changed files with 2 additions and 0 deletions
  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">`