The answer is listed explicitly in the documentation you linked…
<todo-item v-for="todoItem in todos"
v-bind:data="todoItem"
v-bind:key="todoItem.text"></todo-item>
To summarise some information from the comments below… you use :key
to let the component know how to identify individual elements. This allows it to keep track of changes for Vue’s reactivity.
It’s best to try and bind the :key
to some uniquely identifying property of each item. For example, an id
.