From a138ff3ae6faa5c658247cdc2dd1bb43eb881f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E4=B8=93?= Date: Fri, 17 Jun 2022 11:36:13 +0800 Subject: [PATCH] fix: fix typo & update naming --- docs/guide/essentials/forms.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/guide/essentials/forms.md b/docs/guide/essentials/forms.md index e90195ee8..d7eecc199 100644 --- a/docs/guide/essentials/forms.md +++ b/docs/guide/essentials/forms.md @@ -364,9 +364,9 @@ Assume we have a form that uses the Vuetify textarea: ```vue @@ -379,8 +379,8 @@ export default { } }, methods: { - handleClick() { - this.$emit('submit', this.description) + handleSubmit() { + this.$emit('submitted', this.description) } } } @@ -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) }) ```