2021-02-25 18:37:07 +00:00
|
|
|
<template>
|
2021-03-01 13:41:35 +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>
|
|
|
|
export default {
|
|
|
|
name: 'action',
|
2021-03-01 13:41:35 +00:00
|
|
|
props: [
|
|
|
|
'icon',
|
|
|
|
'label',
|
|
|
|
'counter',
|
|
|
|
'show'
|
|
|
|
],
|
|
|
|
methods: {
|
|
|
|
action: function () {
|
|
|
|
if (this.show) {
|
|
|
|
this.$store.commit('showHover', this.show)
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$emit('action')
|
|
|
|
}
|
|
|
|
}
|
2021-02-25 18:37:07 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
</style>
|