First Committ
This commit is contained in:
36
src/store/testStore.ts
Normal file
36
src/store/testStore.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
|
||||
export interface ITest {
|
||||
finishLoading: boolean
|
||||
}
|
||||
|
||||
export const useTestStore = defineStore({
|
||||
id: 'TestStore',
|
||||
state: (): ITest => ({
|
||||
finishLoading: false,
|
||||
}),
|
||||
|
||||
getters: {
|
||||
|
||||
isMyLang: (state: ITest) => (rec: { lang: string }): boolean => {
|
||||
if (!rec.lang) return true
|
||||
|
||||
return (rec.lang === toolsext.getLocale(false) || toolsext.getLocale() === '')
|
||||
},
|
||||
|
||||
prova2(): boolean {
|
||||
return this.finishLoading
|
||||
},
|
||||
},
|
||||
|
||||
actions: {
|
||||
async testProva() {
|
||||
let arrpagesroute = null
|
||||
|
||||
arrpagesroute = this.isMyLang({ lang: 'test' })
|
||||
},
|
||||
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user