Skip to content

Commit

Permalink
docs: add emits to v-movel documentation
Browse files Browse the repository at this point in the history
As reported by #1969, the `emits` field of a component needs to be defined to properly typecheck.
  • Loading branch information
cexbrayat committed Feb 9, 2023
1 parent 77a69a8 commit 53a4cd0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/guide/advanced/v-model.md
Expand Up @@ -30,7 +30,8 @@ const App {
components: {
Editor
},
template: `<editor v-model="text" label="test" />`
template: `<editor v-model="text" label="test" />`,
emits: ['update:modelValue'],
data(){
return {
text: 'test'
Expand Down Expand Up @@ -69,7 +70,8 @@ const MoneyEditor = {
<input :value="currency" @input="$emit('update:currency', $event.target.value)"/>
<input :value="modelValue" type="number" @input="$emit('update:modelValue', $event.target.value)"/>
</div>`,
props: ['currency', 'modelValue']
props: ['currency', 'modelValue'],
emits: ['update:currency', 'update:modelValue']
}
```

Expand Down

0 comments on commit 53a4cd0

Please sign in to comment.