Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Vue.jsの親子関係
<div id='list'>
<child v-for='item in items' :key='item.id' :child='item'></child>
</div>
<script>
Vue.component('child', {
props: ['child'],
template: '<li>{{ child.name }}</li>'
})
app = new Vue({
el: '#list',
data: {
items: [
{ name: 'item1'},
{ name: 'item2'},
{ name: 'item3'},
]
}
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment