Skip to content

Commit fb9ed21

Browse files
authored
docs: replace foo in v-model arguments (#557)
1 parent 9ae70db commit fb9ed21

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/guide/component-custom-events.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,29 @@ app.component('custom-form', {
7474
By default, `v-model` on a component uses `modelValue` as the prop and `update:modelValue` as the event. We can modify these names passing an argument to `v-model`:
7575

7676
```html
77-
<my-component v-model:foo="bar"></my-component>
77+
<my-component v-model:title="bookTitle"></my-component>
7878
```
7979

80-
In this case, child component will expect a `foo` prop and emits `update:foo` event to sync:
80+
In this case, child component will expect a `title` prop and emits `update:title` event to sync:
8181

8282
```js
8383
const app = Vue.createApp({})
8484

8585
app.component('my-component', {
8686
props: {
87-
foo: String
87+
title: String
8888
},
8989
template: `
9090
<input
9191
type="text"
92-
:value="foo"
93-
@input="$emit('update:foo', $event.target.value)">
92+
:value="title"
93+
@input="$emit('update:title', $event.target.value)">
9494
`
9595
})
9696
```
9797

9898
```html
99-
<my-component v-model:foo="bar"></my-component>
99+
<my-component v-model:title="bookTitle"></my-component>
100100
```
101101

102102
## Multiple `v-model` bindings

0 commit comments

Comments
 (0)