Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Recursive nested list Vue component
<ol v-if="Array.isArray(value)">
<li v-for="(item, index) in value" :key="index">
<Nested :value="item" />
<ul v-else-if="typeof value == 'object' && !!value">
<li v-for="(val, name) in value" :key="name">
{{ name }}:
<Nested :value="val" />
<span v-else>{{ value }}</span>
export default {
name: "Nested",
props: ["value"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment