mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-26 00:34:01 +00:00
test
This commit is contained in:
parent
d26592c25e
commit
ac55722f22
|
@ -19,22 +19,24 @@ import {
|
||||||
* with the Store instance.
|
* with the Store instance.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export interface StateInterface {
|
export interface AccountStateInterface {
|
||||||
// Define your own store structure, using submodules if needed
|
account: {
|
||||||
// example: ExampleStateInterface;
|
username: string
|
||||||
// Declared as unknown to avoid linting issue. Best to strongly type as per the line above.
|
token: string
|
||||||
example: unknown
|
}
|
||||||
|
isLogin: boolean
|
||||||
|
taskList: any[]
|
||||||
}
|
}
|
||||||
|
|
||||||
// provide typings for `this.$store`
|
// provide typings for `this.$store`
|
||||||
declare module '@vue/runtime-core' {
|
declare module '@vue/runtime-core' {
|
||||||
interface ComponentCustomProperties {
|
interface ComponentCustomProperties {
|
||||||
$store: VuexStore<StateInterface>
|
$store: VuexStore<AccountStateInterface>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// provide typings for `useStore` helper
|
// provide typings for `useStore` helper
|
||||||
export const storeKey: InjectionKey<VuexStore<StateInterface>> = Symbol('vuex-key')
|
export const storeKey: InjectionKey<VuexStore<AccountStateInterface>> = Symbol('vuex-key')
|
||||||
|
|
||||||
// Provide typings for `this.$router` inside Vuex stores
|
// Provide typings for `this.$router` inside Vuex stores
|
||||||
declare module "vuex" {
|
declare module "vuex" {
|
||||||
|
@ -44,12 +46,8 @@ declare module "vuex" {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default store(function (/* { ssrContext } */) {
|
export default store(function(/* { ssrContext } */) {
|
||||||
const Store = createStore<StateInterface>({
|
const Store = createStore<AccountStateInterface>({
|
||||||
modules: {
|
|
||||||
// example
|
|
||||||
},
|
|
||||||
|
|
||||||
// enable strict mode (adds overhead!)
|
// enable strict mode (adds overhead!)
|
||||||
// for dev mode and --debug builds only
|
// for dev mode and --debug builds only
|
||||||
strict: !!process.env.DEBUGGING
|
strict: !!process.env.DEBUGGING
|
||||||
|
|
Loading…
Reference in New Issue
Block a user