Skip to content

Commit 2879fa4

Browse files
emanuelgasparchrisvfritz
authored andcommitted
clarify introductory component example (#526)
* 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 ) * clarify introductory component example
1 parent 8940f5e commit 2879fa4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/guide/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ Now we can pass the todo into each repeated component using `v-bind`:
296296
</div>
297297
```
298298
``` js
299+
Vue.component('todo-item', {
300+
props: ['todo'],
301+
template: '<li>{{ todo.text }}</li>'
302+
})
299303
var app7 = new Vue({
300304
el: '#app-7',
301305
data: {

0 commit comments

Comments
 (0)