From cd47f3ba50255665684ad099b8bed853499947c0 Mon Sep 17 00:00:00 2001 From: harapeko Date: Fri, 19 Mar 2021 04:58:20 +0900 Subject: [PATCH] =?UTF-8?q?update=20emit=E3=81=AE=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=82=92camel=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F(?= =?UTF-8?q?=E5=8E=9F=E6=96=87=E3=81=AB=E8=BF=BD=E5=BE=93)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/instance-methods.md | 12 ++++++++---- src/guide/component-basics.md | 6 +++--- src/guide/component-custom-events.md | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/api/instance-methods.md b/src/api/instance-methods.md index d56904c3..e042a22a 100644 --- a/src/api/instance-methods.md +++ b/src/api/instance-methods.md @@ -192,7 +192,7 @@ ``` ```js - const app = Vue.createApp({ + const app = createApp({ methods: { sayHi() { console.log('Hi!') @@ -201,6 +201,7 @@ }) app.component('welcome-button', { + emits: ['welcome'], template: ` ` }) + + app.mount('#emit-example-argument') ``` - **See also:** diff --git a/src/guide/component-basics.md b/src/guide/component-basics.md index c114a07f..4f8dacc3 100644 --- a/src/guide/component-basics.md +++ b/src/guide/component-basics.md @@ -233,7 +233,7 @@ app.component('blog-post', { そして子コンポーネントはビルトインの [**`$emit`** メソッド](../api/instance-methods.html#emit)にイベントの名前を渡して呼び出すことで、イベントを送出することができます: ```html - ``` @@ -252,7 +252,7 @@ app.component('blog-post', { ```js app.component('blog-post', { props: ['title'], - emits: ['enlarge-text'] + emits: ['enlargeText'] }) ``` @@ -263,7 +263,7 @@ app.component('blog-post', { イベントを特定の値と一緒に送出すると便利な場合があります。例えば、テキストをどれだけ大きく表示するかを `` コンポーネントの責務とさせたいかもしれません。そのような場合、 `$emit` の第二引数を使ってこの値を渡すことができます: ```html - ``` diff --git a/src/guide/component-custom-events.md b/src/guide/component-custom-events.md index ce7d257a..7efddb72 100644 --- a/src/guide/component-custom-events.md +++ b/src/guide/component-custom-events.md @@ -27,7 +27,7 @@ this.$emit('myEvent') ```js app.component('custom-form', { - emits: ['in-focus', 'submit'] + emits: ['inFocus', 'submit'] }) ```