Files
myprojplanet_vite/src/store/testStore.ts

35 lines
672 B
TypeScript
Raw Normal View History

2021-08-31 18:09:59 +02:00
import { defineStore } from 'pinia'
2025-03-01 14:14:43 +01:00
import { tools } from '@tools'
2021-08-31 18:09:59 +02:00
import { toolsext } from '@store/Modules/toolsext'
export interface ITest {
finishLoading: boolean
}
2025-03-01 14:14:43 +01:00
export const useTestStore = defineStore(
'TestStore',
{
state: (): ITest => ({
finishLoading: false,
}),
2021-08-31 18:09:59 +02:00
2025-03-01 14:14:43 +01:00
getters: {
2021-08-31 18:09:59 +02:00
2025-03-01 14:14:43 +01:00
isMyLang: (state: ITest) => (rec: { lang: string }): boolean => {
if (!rec.lang) return true
return (rec.lang === toolsext.getLocale(false) || toolsext.getLocale() === '')
},
2021-08-31 18:09:59 +02:00
},
2025-03-01 14:14:43 +01:00
actions: {
testProva() {
let arrpagesroute = null
2021-08-31 18:09:59 +02:00
2025-03-01 14:14:43 +01:00
arrpagesroute = this.isMyLang({ lang: 'test' })
},
2021-08-31 18:09:59 +02:00
},
2025-03-01 14:14:43 +01:00
})