TS2345: Argument of type 'StoreOptions' is not assignable to parameter of type 'Plugin_2'. Property 'install' is missing in type 'StoreOptions' but required in type '{ install: PluginInstallFunction; }'.
const app = createApp(App)
app.use(store, key)
app.use(router)
app.use(...)
app.mount("#app")
store:
export interface RootState {}
const state: RootState = {}
export interface TypeState extends RootState {
markdown: MarkdownState
user: UserState
fileTree: FileTreeState
editor: EditorState
}
export const key: InjectionKey<Store<TypeState>> = Symbol("storeKey")
export const store: StoreOptions<RootState> = createStore({
state,
modules: {
markdown,
user,
fileTree,
editor,
},
plugins: [
createPersistedState({
paths: ["user", "fileTree", "markdown"],
}),
],
})
export function useStore() {
return baseUseStore(key)
}
