Caleb Porzio 5 лет назад
Родитель
Сommit
205b10de54
1 измененных файлов с 13 добавлено и 3 удалено
  1. 13 3
      README.md

+ 13 - 3
README.md

@@ -48,6 +48,7 @@ There are 5 directives available to you:
 Here's how they each work:
 Here's how they each work:
 
 
 ### x-data
 ### x-data
+---
 Example: `<div x-data="{ foo: 'bar' }">...</div>`
 Example: `<div x-data="{ foo: 'bar' }">...</div>`
 
 
 Structure: `<div x-data="[JSON data object]">...</div>`
 Structure: `<div x-data="[JSON data object]">...</div>`
@@ -65,7 +66,8 @@ Structure: `<input x-bind:[attribute]="[expression]">`
 
 
 > Note: attribute bindings ONLY update when their dependancies update. The framework is smart enough to observe data changes and detect which bindings care about them.
 > Note: attribute bindings ONLY update when their dependancies update. The framework is smart enough to observe data changes and detect which bindings care about them.
 
 
-#### `x-bind` Class Attribute
+**`x-bind` for class attributes**
+
 `x-bind` behaves a little differently when binding to the `class` attribute.
 `x-bind` behaves a little differently when binding to the `class` attribute.
 
 
 For classes, you pass in an object who's keys are class names, and values are boolean expressions to determine if those class names are applied or not.
 For classes, you pass in an object who's keys are class names, and values are boolean expressions to determine if those class names are applied or not.
@@ -84,8 +86,7 @@ Structure: `<button x-on:[event]="[expression]"></button>`
 
 
 If any data is modified in the expression, other element attributes "bound" to this data, will be updated.
 If any data is modified in the expression, other element attributes "bound" to this data, will be updated.
 
 
-#### Modifiers
-**`.away`**
+**`.away` modifier**
 
 
 Example: `<div x-on:click.away="showModal = false"></div>`
 Example: `<div x-on:click.away="showModal = false"></div>`
 
 
@@ -99,3 +100,12 @@ Example: `<input type="text" x-model="foo">`
 Structure: `<input type="text" x-model="[data item]">`
 Structure: `<input type="text" x-model="[data item]">`
 
 
 `x-model` adds "two-way data binding" to an element. In other words, the value of the input element will be kept in sync with the value of the data item of the component.
 `x-model` adds "two-way data binding" to an element. In other words, the value of the input element will be kept in sync with the value of the data item of the component.
+
+> Note: `x-model` is smart enough to detect changes on text inputs, checkboxes, radio buttons, textareas, selects, and multiple selects. It should behave [how Vue would](https://vuejs.org/v2/guide/forms.html) in those scenarios.
+
+### `x-text`
+Example: `<span x-text="foo"></span>`
+
+Structure: `<span x-text="[expression]"`
+
+`x-text` works similarly to `x-bind`, except instead of updating the value of an attribute, it will update the `innerText` of an element.