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