diff --git a/src/store/index.ts b/src/store/index.ts index 5e3e1ec..ca5bee5 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,14 +1,5 @@ import { store } from 'quasar/wrappers' -import { InjectionKey } from 'vue' -import { Router } from 'vue-router' -import { - createStore, - Store as VuexStore, - useStore as vuexUseStore, -} from 'vuex' - -// import example from './module-example' -// import { ExampleStateInterface } from './module-example/state'; +import { createPinia } from 'pinia' /* * If not building with SSR mode, you can @@ -19,45 +10,11 @@ import { * with the Store instance. */ -export interface StateInterface { - // Define your own store structure, using submodules if needed - // example: ExampleStateInterface; - // Declared as unknown to avoid linting issue. Best to strongly type as per the line above. - example: unknown -} +export default store((/* { ssrContext } */) => { + const pinia = createPinia() -// provide typings for `this.$store` -declare module '@vue/runtime-core' { - interface ComponentCustomProperties { - $store: VuexStore - } -} + // You can add Pinia plugins here + // pinia.use(SomePiniaPlugin) -// provide typings for `useStore` helper -export const storeKey: InjectionKey> = Symbol('vuex-key') - -// Provide typings for `this.$router` inside Vuex stores -declare module "vuex" { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - export interface Store { - readonly $router: Router; - } -} - -export default store(function (/* { ssrContext } */) { - const Store = createStore({ - modules: { - // example - }, - - // enable strict mode (adds overhead!) - // for dev mode and --debug builds only - strict: !!process.env.DEBUGGING - }) - - return Store; + return pinia }) - -export function useStore() { - return vuexUseStore(storeKey) -}