2020-07-26 23:34:20 -05:00
|
|
|
<template>
|
2020-08-09 01:51:02 -05:00
|
|
|
<div class="pxhvhrfw" v-size="{ max: [500] }">
|
2020-07-27 20:08:08 -05:00
|
|
|
<button v-for="item in items" class="_button" @click="$emit('input', item.value)" :class="{ active: value === item.value }" :key="item.value"><fa v-if="item.icon" :icon="item.icon" class="icon"/>{{ item.label }}</button>
|
2020-07-26 23:34:20 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
props: {
|
|
|
|
items: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
value: {
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.pxhvhrfw {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
flex: 1;
|
|
|
|
padding: 11px 8px 8px 8px;
|
|
|
|
border-bottom: solid 3px transparent;
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
|
|
|
border-bottom-color: var(--accent);
|
|
|
|
}
|
2020-07-27 20:08:08 -05:00
|
|
|
|
|
|
|
> .icon {
|
|
|
|
margin-right: 6px;
|
|
|
|
}
|
2020-07-26 23:34:20 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
&.max-width_500px {
|
|
|
|
font-size: 80%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|