Updated Action.vue to composition api & typescript.
This commit is contained in:
parent
23fd2e1466
commit
bb8c67fa8c
@ -6,24 +6,28 @@
|
|||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
import { mapActions } from "pinia";
|
|
||||||
import { useLayoutStore } from "@/stores/layout";
|
import { useLayoutStore } from "@/stores/layout";
|
||||||
|
|
||||||
export default {
|
defineProps<{
|
||||||
name: "action",
|
icon: any;
|
||||||
props: ["icon", "label", "counter", "show"],
|
label: any;
|
||||||
methods: {
|
counter: any;
|
||||||
...mapActions(useLayoutStore, ["showHover"]),
|
show: any;
|
||||||
action: function () {
|
}>();
|
||||||
if (this.show) {
|
|
||||||
this.showHover(this.show);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$emit("action");
|
const emit = defineEmits<{
|
||||||
},
|
(e: "action"): void;
|
||||||
},
|
}>();
|
||||||
|
|
||||||
|
const layoutStore = useLayoutStore();
|
||||||
|
|
||||||
|
const action = () => {
|
||||||
|
if (layoutStore.show) {
|
||||||
|
// TODO: is not very pretty
|
||||||
|
layoutStore.showHover(layoutStore.show as string);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit("action");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user