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'] }) ```