Skip to content

Commit c908e6f

Browse files
committed
Add tips about v-model vs initial values
1 parent 811316e commit c908e6f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/guide/forms.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ order: 10
88

99
You can use the `v-model` directive to create two-way data bindings on form input and textarea elements. It automatically picks the correct way to update the element based on the input type. Although a bit magical, `v-model` is essentially syntax sugar for updating data on user input events, plus special care for some edge cases.
1010

11+
<p class="tip">`v-model` doesn't care about the initial value provided to an input or a textarea. It will always treat the Vue instance data as the source of truth.</p>
12+
1113
### Text
1214

1315
``` html
@@ -55,6 +57,11 @@ new Vue({
5557
</script>
5658
{% endraw %}
5759

60+
61+
{% raw %}
62+
<p class="tip">Interpolation on textareas (<code>&lt;textarea&gt;{{text}}&lt;/textarea&gt;</code>) won't work. Use <code>v-model</code> instead.</p>
63+
{% endraw %}
64+
5865
### Checkbox
5966

6067
Single checkbox, boolean value:

0 commit comments

Comments
 (0)