filebrowser/frontend/src/components/Action.vue

29 lines
602 B
Vue
Raw Normal View History

2021-02-25 18:37:07 +00:00
<template>
2025-01-05 19:05:33 +00:00
<button @click="action" :aria-label="label" :title="label" class="action no-select">
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>
2024-07-30 17:45:27 +00:00
import { mutations } from "@/store"; // Import your custom store
2021-02-25 18:37:07 +00:00
export default {
2021-03-21 11:51:58 +00:00
name: "action",
props: ["icon", "label", "counter", "show"],
methods: {
action: function () {
if (this.show) {
2024-07-30 17:45:27 +00:00
mutations.showHover(this.show);
}
2021-03-21 11:51:58 +00:00
this.$emit("action");
},
},
};
2021-02-25 18:37:07 +00:00
</script>
2024-08-03 15:34:12 +00:00
<style>
</style>