Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix typo #1608

Merged
merged 1 commit into from Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 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 @@ -390,15 +390,15 @@ export default {
We can use `findComponent` to find the component instance, and then set its value.

```js
test('emits textarea value on click', async () => {
test('emits textarea value on submit', async () => {
const wrapper = mount(CustomTextarea)
const description = 'Some very long text...'

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

wrapper.find('.submit').trigger('click')
wrapper.find('form').trigger('submit')

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

Expand Down