Fix broken Action.vue
This commit is contained in:
parent
e48c3eaea7
commit
8471a3ed78
@ -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");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user