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
Raw Normal View History

2020-11-27 11:30:21 -08:00
<template>
<ul class="list-unstyled">
<li v-for="(value, key, i) in data" v-if="expanded || i < 10">
2020-11-27 12:51:40 -08:00
<slot v-bind:k="key" v-bind:v="value">
2020-11-27 11:30:21 -08:00
<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>