8000 Update Component.md(Original #1116,#1117) (#336) · kaorun343/jp.vuejs.org@037451f · GitHub
[go: up one dir, main page]

Skip to content

Commit 037451f

Browse files
chi-bdre-fort
authored andcommitted
Update Component.md(Original vuejs#1116,vuejs#1117) (vuejs#336)
* Add v-bind example to components (vuejs#1116) * Add v-bind example to components * Tweak explanation of v-bind object syntax in guide * Update components.md (vuejs#1117) * Translate into Japanese * update timestamp
1 parent d7577aa commit 037451f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/v2/guide/components.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: コンポーネント
3-
updated: 2017-09-08
3+
updated: 2017-09-16
44
type: guide
55
order: 11
66
---
@@ -327,6 +327,30 @@ new Vue({
327327
</script>
328328
{% endraw %}
329329

330+
もしオブジェクト内のすべてのプロパティを props として渡したいのであれば、 `v-bind` を引数なしで使う( `v-bind:プロパティ名` の代わりに `v-bind` )ことができます。例えば、 `todo` オブジェクトを与えるには:
331+
332+
``` js
333+
todo: {
334+
text: 'Learn Vue',
335+
isComplete: false
336+
}
337+
```
338+
339+
そして:
340+
341+
``` html
342+
<todo-item v-bind="todo"></todo-item>
343+
```
344+
345+
これは以下と等価です:
346+
347+
``` html
348+
<todo-item
349+
v-bind:text="todo.text"
350+
v-bind:is-complete="todo.isComplete"
351+
></todo-item>
352+
```
353+
330354
### リテラル vs 動的
331355

332356
初心者にありがちな誤りは、リテラル構文を使用して数を渡そうとすることです:

0 commit comments

Comments
 (0)
0