adrema/resources/js/components/SidebarHeader.vue

49 lines
1.6 KiB
Vue
Raw Normal View History

2021-07-04 16:56:07 +02:00
<template>
<div class="h-16 px-6 flex justify-between items-center border-b border-solid border-gray-500">
<div class="flex items-center">
2021-07-05 00:35:38 +02:00
<span class="mr-1 text-xl font-semibold leading-none text-white" v-html="title"></span>
2022-12-04 23:40:35 +01:00
<a
v-for="(link, index) in links.filter((link) => link.icon === undefined)"
:key="index"
@click.prevent="$emit(link.event)"
href="#"
class="btn label btn-primary-light"
>
2021-07-05 00:35:38 +02:00
<span v-if="link.label" v-text="link.label"></span>
2022-02-12 15:22:22 +01:00
<svg-sprite v-if="link.icon" :src="link.icon"></svg-sprite>
2021-07-05 00:35:38 +02:00
</a>
2022-12-04 23:40:35 +01:00
<a
v-for="(link, index) in links.filter((link) => link.icon !== undefined)"
:key="index"
:href="link.href"
class="btn label icon btn-primary-light ml-1"
>
2021-07-05 00:35:38 +02:00
<span v-if="link.label" v-text="link.label"></span>
2022-02-12 15:22:22 +01:00
<svg-sprite v-if="link.icon" :src="link.icon"></svg-sprite>
2021-07-05 00:35:38 +02:00
</a>
2021-07-04 16:56:07 +02:00
</div>
<div class="flex ml-4">
<a href="#" @click.prevent="$emit('close')" class="btn label btn-primary-light icon">
2022-02-12 15:22:22 +01:00
<svg-sprite class="w-3 h-3" src="close"></svg-sprite>
2021-07-04 16:56:07 +02:00
</a>
</div>
</div>
</template>
<script>
export default {
props: {
links: {
2022-12-04 23:40:35 +01:00
default: function () {
return [];
},
2021-07-04 16:56:07 +02:00
},
title: {
2022-12-04 23:40:35 +01:00
default: function () {
return '';
},
},
},
2021-07-04 16:56:07 +02:00
};
</script>