vuejs nested v-for
<div v-for='(obj, key, index) in secondPanelDetails'
v-bind:key='index'
class='detail-wrapper'>
<span>{{ key }}:</span>
<span v-if='Array.isArray(obj)'>
<div v-for='(el, index) in obj'
v-bind:key='index'>
{{ el }}
</div>
</span>
<span v-else>{{ obj }}</span>
</div>
new Vue({
el: '#sample',
data: {
private: {
folders : [{
name : 'folder1',
checks : [
{ name : 'check1.1' },
{ name : 'check1.2' }
]
},
{
name : 'folder2',
checks : [
{ name : 'check2.1' },
{ name : 'check2.2' }
]
}
]
}
}
})
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
<div id="sample">
<div v-if = "private.folders!=null" v-for="folder in private.folders">
{{folder.name}}
<div v-for="check in folder.checks">
{{check.name}}
</div>
</div>
</div>
Also in JavaScript:
- split array javascript
- .index of javascript
- js percorrer objeto
- jquery enforce important
- how to create a constant in javascript
- node list files in directory
- digitally signed react native
- angular serve
- Write a javascript function that takes two arguments and should either sum them or just print the first one if the second one is undefined. If both are undefined print "No numbers given"
- js is empty object
- javascript absolute value
- hide warnings in expo app
- multiple event with javascript
- godot get root node
- javascript get child by name
- javascript input value change
- python json dump format
- angular ng serve with custom port
- react native vector icons
- crear componente con angular cli
- square brackets vs curly brackets javascript
- react native updating options with setoptions
- javascript Error: Invalid web service call, missing value for parameter: 'documentId'.
- toggle class in javascript