Skip to content

Commit 0ff401b

Browse files
committed
feat: emit途中まで
1 parent 99d191c commit 0ff401b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/guide/component-basics.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ app.mount('#blog-posts-demo')
168168

169169
とりあえずプロパティについてはこれで以上ですが、 このページを読み終えて十分に理解できたら、後から戻ってきて [プロパティ](component-props.html) の完全なガイドを読むことをお勧めします。
170170

171-
## Listening to Child Components Events
171+
## 子コンポーネントのイベントを購読する
172172

173-
As we develop our `<blog-post>` component, some features may require communicating back up to the parent. For example, we may decide to include an accessibility feature to enlarge the text of blog posts, while leaving the rest of the page its default size.
173+
`<blog-post>` コンポーネントを開発する中で、いくつかの機能で親コンポーネントとの通信が必要になるかもしれません。例えば、残りの部分の大きさはそのままで、ブログ記事の文字の文字を拡大するアクセシビリティ機能を実装することを決めるかもしれません。
174174

175-
In the parent, we can support this feature by adding a `postFontSize` data property:
175+
親コンポーネントでは、`postFontSize` データプロパティを追加することでこの機能をサポートすることができます:
176176

177177
```js
178178
const App = {
@@ -187,7 +187,7 @@ const App = {
187187
}
188188
```
189189

190-
Which can be used in the template to control the font size of all blog posts:
190+
すべてのブログ投稿のフォントサイズを制御するためにテンプレート内で使用できます:
191191

192192
```html
193193
<div id="blog-posts-events-demo">
@@ -197,7 +197,7 @@ Which can be used in the template to control the font size of all blog posts:
197197
</div>
198198
```
199199

200-
Now let's add a button to enlarge the text right before the content of every post:
200+
それでは、すべての投稿の内容の前にテキストを拡大するボタンを追加します:
201201

202202
```js
203203
app.component('blog-post', {
@@ -213,13 +213,13 @@ app.component('blog-post', {
213213
})
214214
```
215215

216-
The problem is, this button doesn't do anything:
216+
問題は、このボタンが何もしないことです:
217217

218218
```html
219219
<button>Enlarge text</button>
220220
```
221221

222-
When we click on the button, we need to communicate to the parent that it should enlarge the text of all posts. Fortunately, component instances provide a custom events system to solve this problem. The parent can choose to listen to any event on the child component instance with `v-on` or `@`, just as we would with a native DOM event:
222+
ボタンをクリックすると、全ての投稿のテキストを拡大する必要があることを親に伝える必要があります。親は、ネイティブ DOM イベントでの場合と同様に、 `v-on` `@` を用いて子コンポーネントのインスタンスでのイベントを購読することができます:
223223

224224
```html
225225
<blog-post ... @enlarge-text="postFontSize += 0.1"></blog-post>

0 commit comments

Comments
 (0)