فهرست منبع

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`