소스 검색

Merge pull request #13 from guillermo7227/patch-1

Add x-bind usage for boolen attributes to README file
Caleb Porzio 5 년 전
부모
커밋
3f2b72eb56
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      README.md

+ 11 - 0
README.md

@@ -132,6 +132,17 @@ For example:
 
 In this example, the "hidden" class will only be applied when the value of the `foo` data attribute is `true`.
 
+**`x-bind` for boolean attributes**
+
+`x-bind` supports boolean attributes in the same way that value attributes, using a variable as the condition or any JavaScript expression that resolves to `true` or `false`.
+
+For example:
+`<button x-bind:disabled="myVar">Click me</button>`
+
+This will add or remove the `disabled` attribute when `myVar` is true or false respectively. 
+
+Most common boolean attributes are supported, like `readonly`, `required`, etc.
+
 ---
 
 ### `x-on`