This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/components/ListExpandable.vue

30 lines
706 B
Vue

<template>
<ul class="list-unstyled">
<li v-for="(value, key, i) in data" v-if="expanded || i < 10">
<slot v-bind:k="k" v-bind:v="v">
<strong>{{key}}</strong>: {{value}}
</slot>
</li>
<li v-if="!expanded">
<a href="#" @click.prevent="expanded = true">
<T>table.more</T>
<Icon v="caret-down"/>
</a>
</li>
</ul>
</template>
<script>
export default {
props: {
data: { required: true },
initial: { default: 10, },
},
data() {
return {
expanded: false,
};
}
}
</script>