Fix broken Action.vue

This commit is contained in:
Kloon ImKloon 2023-10-10 12:27:03 +02:00
parent e48c3eaea7
commit 8471a3ed78
No known key found for this signature in database
GPG Key ID: CCF1C86A995C5B6A

View File

@ -2,18 +2,18 @@
<button @click="action" :aria-label="label" :title="label" class="action">
<i class="material-icons">{{ icon }}</i>
<span>{{ label }}</span>
<span v-if="counter > 0" class="counter">{{ counter }}</span>
<span v-if="counter && counter > 0" class="counter">{{ counter }}</span>
</button>
</template>
<script setup lang="ts">
import { useLayoutStore } from "@/stores/layout";
defineProps<{
const props = defineProps<{
icon?: string;
label?: any;
counter?: any;
show?: any;
label?: string;
counter?: number;
show?: string;
}>();
const emit = defineEmits<{
@ -23,9 +23,8 @@ const emit = defineEmits<{
const layoutStore = useLayoutStore();
const action = () => {
if (layoutStore.show) {
// TODO: is not very pretty
layoutStore.showHover(layoutStore.show as string);
if (props.show) {
layoutStore.showHover(props.show);
}
emit("action");