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>
|
2021-03-01 13:41:35 +00:00
|
|
|
<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"],
|
2021-03-01 13:41:35 +00:00
|
|
|
methods: {
|
|
|
|
action: function () {
|
|
|
|
if (this.show) {
|
2024-07-30 17:45:27 +00:00
|
|
|
mutations.showHover(this.show);
|
2021-03-01 13:41:35 +00:00
|
|
|
}
|
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>
|