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
712 B
Vue

<template>
<ul class="list-unstyled">
<li v-for="(value, key, i) in data" v-if="expanded || i < 10">
<slot v-bind:k="key" v-bind:v="value">
<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>