8000 Update Component.md(Original #1116,#1117) by chi-bd · Pull Request #336 · vuejs/jp.vuejs.org · GitHub
[go: up one dir, main page]

Skip to content

Update Component.md(Original #1116,#1117) #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/v2/guide/components.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: コンポーネント
updated: 2017-09-08
updated: 2017-09-16
type: guide
order: 11
---
Expand Down Expand Up @@ -327,6 +327,30 @@ new Vue({
</script>
{% endraw %}

もしオブジェクト内のすべてのプロパティを props として渡したいのであれば、 `v-bind` を引数なしで使う( `v-bind:プロパティ名` の代わりに `v-bind` )ことができます。例えば、 `todo` オブジェクトを与えるには:

``` js
todo: {
text: 'Learn Vue',
isComplete: false
}
```

そして:

``` html
<todo-item v-bind="todo"></todo-item>
```

これは以下と等価です:

``` html
<todo-item
v-bind:text="todo.text"
v-bind:is-complete="todo.isComplete"
></todo-item>
```

### リテラル vs 動的

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