Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/guide/component-custom-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,29 +74,29 @@ app.component('custom-form', {
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`:

```html
<my-component v-model:foo="bar"></my-component>
<my-component v-model:title="bookTitle"></my-component>
```

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

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

app.component('my-component', {
props: {
foo: String
title: String
},
template: `
<input
type="text"
:value="foo"
@input="$emit('update:foo', $event.target.value)">
:value="title"
@input="$emit('update:title', $event.target.value)">
`
})
```

```html
<my-component v-model:foo="bar"></my-component>
<my-component v-model:title="bookTitle"></my-component>
```

## Multiple `v-model` bindings
Expand Down