I can't figure out how to do a console.log
to see what item is in the ul
as its being passed.
<div v-for="(item, index) in todos" :key="index">
<ul v-if="item" :load="console.log(item)">
<li v-for="(value, key) in item" :key="key">
<label v-bind:for="key">{{ key }}</label>
<div v-bind:id="key">{{ value }}</div>
</li>
</ul>
</div>
var vm = new Vue({
el: '#components-demo',
data: {
todos: [
newData
]
}
})
Data is the private memory of each component where you can store any variables you need. Props are how you pass this data from a parent component down to a child component. Join 11,067 other Vue devs and get exclusive tips and insights delivered straight to your inbox, every week.
you should define a method like :
<ul v-if="item" :load="log(item)">
in your script :
var vm = new Vue({
el: '#components-demo',
data: {
todos: [
newData
]
},
methods: {
log(item) {
console.log(item)
}
}
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With