perf: add type support to usePluginStore

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/588/head
Ryan Wang 2 years ago
parent 1567b52e15
commit 0b9dba88b4

@ -1,12 +1,16 @@
import { defineStore } from "pinia";
import type { Plugin } from "@halo-dev/api-client";
interface PluginStoreState {
plugins: Plugin[];
}
export const usePluginStore = defineStore("plugin", {
state: () => ({
state: (): PluginStoreState => ({
plugins: [],
}),
actions: {
registerPlugin(plugin) {
// @ts-ignore
registerPlugin(plugin: Plugin) {
this.plugins.push(plugin);
},
},

Loading…
Cancel
Save