filebrowser/frontend/src/components/header/HeaderBar.vue

59 lines
1.1 KiB
Vue
Raw Normal View History

2021-02-25 18:37:07 +00:00
<template>
<header>
<img v-if="showLogo !== undefined" :src="logoURL" />
2021-03-21 11:51:58 +00:00
<action
v-if="showMenu !== undefined"
class="menu-button"
icon="menu"
:label="$t('buttons.toggleSidebar')"
@action="openSidebar()"
/>
2021-02-25 18:37:07 +00:00
<slot />
<div id="dropdown" :class="{ active: this.$store.state.show === 'more' }">
<slot name="actions" />
</div>
2021-03-21 11:51:58 +00:00
<action
v-if="this.$slots.actions"
id="more"
icon="more_vert"
:label="$t('buttons.more')"
@action="$store.commit('showHover', 'more')"
/>
<div
class="overlay"
v-show="this.$store.state.show == 'more'"
@click="$store.commit('closeHovers')"
/>
2021-02-25 18:37:07 +00:00
</header>
</template>
<script>
2021-03-21 11:51:58 +00:00
import { logoURL } from "@/utils/constants";
2021-02-25 18:37:07 +00:00
2021-03-21 11:51:58 +00:00
import Action from "@/components/header/Action";
2021-02-25 18:37:07 +00:00
export default {
2021-03-21 11:51:58 +00:00
name: "header-bar",
props: ["showLogo", "showMenu"],
2021-02-25 18:37:07 +00:00
components: {
2021-03-21 11:51:58 +00:00
Action,
2021-02-25 18:37:07 +00:00
},
data: function () {
return {
2021-03-21 11:51:58 +00:00
logoURL,
};
2021-02-25 18:37:07 +00:00
},
methods: {
2021-03-21 11:51:58 +00:00
openSidebar() {
this.$store.commit("showHover", "sidebar");
},
},
};
2021-02-25 18:37:07 +00:00
</script>
2021-03-21 11:51:58 +00:00
<style></style>