Skip to content

Commit d3d2c78

Browse files
smith153chrisvfritz
authored andcommitted
Document v-model.number behavior for invalid strings (#1742)
1 parent 9ba7f2d commit d3d2c78

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/v2/api/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ type: api
21402140

21412141
- **Modifiers:**
21422142
- [`.lazy`](../guide/forms.html#lazy) - listen to `change` events instead of `input`
2143-
- [`.number`](../guide/forms.html#number) - cast input string to numbers
2143+
- [`.number`](../guide/forms.html#number) - cast valid input string to numbers
21442144
- [`.trim`](../guide/forms.html#trim) - trim input
21452145

21462146
- **Usage:**

src/v2/guide/forms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ If you want user input to be automatically typecast as a number, you can add the
368368
<input v-model.number="age" type="number">
369369
```
370370

371-
This is often useful, because even with `type="number"`, the value of HTML input elements always returns a string.
371+
This is often useful, because even with `type="number"`, the value of HTML input elements always returns a string. If the value cannot be parsed with `parseFloat()`, then the original value is returned.
372372

373373
### `.trim`
374374

0 commit comments

Comments
 (0)