Skip to content

Commit

Permalink
fix: fix typo & update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhuan committed Jun 21, 2022
1 parent 71947a7 commit 9ff6ad4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/guide/essentials/forms.md
Expand Up @@ -364,9 +364,9 @@ Assume we have a form that uses the Vuetify textarea:

```vue
<template>
<form>
<form @submit.prevent="handleSubmit">
<v-textarea v-model="description" ref="description" />
<button @click="handleClick">Send</button>
<button type="submit">Send</button>
</form>
</template>
Expand All @@ -379,8 +379,8 @@ export default {
}
},
methods: {
handleClick() {
this.$emit('submit', this.description)
handleSubmit() {
this.$emit('submitted', this.description)
}
}
}
Expand All @@ -396,9 +396,9 @@ test('emits textarea value on click', async () => {

await wrapper.findComponent({ ref: 'description' }).setValue(description)

wrapper.find('.submit').trigger('click')
wrapper.find('button[type=submit]').trigger('click')

expect(wrapper.emitted('submit')[0][0]).toEqual({ description })
expect(wrapper.emitted('submitted')[0][0]).toEqual(description)
})
```

Expand Down

0 comments on commit 9ff6ad4

Please sign in to comment.