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">
|
<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");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user