From 77cfc8183c749865a67d21f3d949fda6bdfc78d9 Mon Sep 17 00:00:00 2001 From: Emanuel Gaspar Date: Thu, 20 Oct 2016 20:13:30 +0100 Subject: [PATCH 1/2] Update index.md I tried to follow the guide and every example worked, except for the components. Upon further investigation, I found the issue: the component must be registered before the Vue instance. This was not clear in the Introductory guide, so I suggest it's added ( I copied the same sentence as seen on https://vuejs.org/guide/components.html ) --- src/guide/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/index.md b/src/guide/index.md index 628606cdfb..e004287252 100644 --- a/src/guide/index.md +++ b/src/guide/index.md @@ -258,7 +258,7 @@ Vue.component('todo-item', { template: '
  • This is a todo
  • ' }) ``` - +Make sure the component is registered before you instantiate the root Vue instance. Now you can compose it in another component's template: ``` html From 1bd04b22c2b255db0e5ac6c9ef343879331899ff Mon Sep 17 00:00:00 2001 From: Chris Fritz Date: Sat, 22 Oct 2016 01:31:47 -0400 Subject: [PATCH 2/2] clarify introductory component example --- src/guide/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/guide/index.md b/src/guide/index.md index e004287252..82c1be5338 100644 --- a/src/guide/index.md +++ b/src/guide/index.md @@ -258,7 +258,7 @@ Vue.component('todo-item', { template: '
  • This is a todo
  • ' }) ``` -Make sure the component is registered before you instantiate the root Vue instance. + Now you can compose it in another component's template: ``` html @@ -296,6 +296,10 @@ Now we can pass the todo into each repeated component using `v-bind`: ``` ``` js +Vue.component('todo-item', { + props: ['todo'], + template: '
  • {{ todo.text }}
  • ' +}) var app7 = new Vue({ el: '#app-7', data: {