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

25 lines
536 B
Vue
Raw Normal View History

2021-02-25 18:37:07 +00:00
<template>
2021-03-21 11:51:58 +00:00
<button @click="action" :aria-label="label" :title="label" class="action">
2021-02-25 18:37:07 +00:00
<i class="material-icons">{{ icon }}</i>
<span>{{ label }}</span>
<span v-if="counter > 0" class="counter">{{ counter }}</span>
2021-02-25 18:37:07 +00:00
</button>
</template>
<script>
export default {
2021-03-21 11:51:58 +00:00
name: "action",
props: ["icon", "label", "counter", "show"],
methods: {
action: function () {
if (this.show) {
2021-03-21 11:51:58 +00:00
this.$store.commit("showHover", this.show);
}
2021-03-21 11:51:58 +00:00
this.$emit("action");
},
},
};
2021-02-25 18:37:07 +00:00
</script>
2021-03-21 11:51:58 +00:00
<style></style>