nuxt-prawo-jazdy/app/stores/examStore.ts
NetMan 625c1013da Nuxt3=>4, spa-loader, css shenanigans...:
...css shenanigans: daisyui may have had a breaking change at 5.3.0, it wrecks the ui here, as tailwind forces its own styles over daisyuis overrides, for now staying at ~5.2.5, for good measure also @nuxtjs/tailwindcss stays at ^6.13.2 (6.13.2 in pnpmlock) - this may be, because (but i'm not sure) @nuxtjs/tailwind is tailwind3 and not tailwind4?

Nuxt3=>4 migration:
also changed nuxtimage settings, as the docs have been fixed, path changes, etc
2025-12-17 21:33:36 +01:00

58 lines
1.2 KiB
TypeScript

export const useBasicStore = defineStore('basicStore', {
state: () => ({
basic: [] as ResultType[],
}),
actions: {
async set(basic: ResultType[]) {
this.basic = basic;
},
},
persist: {
storage: piniaPluginPersistedstate.localStorage(),
},
});
export const useAdvancedStore = defineStore('advancedStore', {
state: () => ({
advanced: [] as ResultType[],
}),
actions: {
async set(advanced: ResultType[]) {
this.advanced = advanced;
},
},
persist: {
storage: piniaPluginPersistedstate.localStorage(),
},
});
export const useExamStore = defineStore('examStore', {
state: () => ({
category: '',
end: false,
lang: 'pl',
}),
actions: {
async setCategory(category: string) {
this.category = category;
},
async setEnd(end: boolean) {
this.end = end;
},
async setLang(lang: string) {
this.lang = lang;
},
async mildReset() {
this.end = false;
useBasicStore().set([]);
useAdvancedStore().set([]);
},
async resetExam() {
this.category = '';
this.mildReset();
},
},
persist: {
storage: piniaPluginPersistedstate.cookies(),
},
});