mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-25 16:34:01 +00:00
getter実装
This commit is contained in:
parent
29135b7d3c
commit
7fd2de6d77
|
@ -1,10 +1,16 @@
|
|||
import { GetterTree } from 'vuex';
|
||||
import { StateInterface } from '../index';
|
||||
import { ExampleStateInterface } from './state';
|
||||
import { AccountStateInterface } from './state';
|
||||
|
||||
const getters: GetterTree<ExampleStateInterface, StateInterface> = {
|
||||
someGetter (/* context */) {
|
||||
// your code
|
||||
const getters: GetterTree<AccountStateInterface, StateInterface> = {
|
||||
getToken(state: AccountStateInterface): string {
|
||||
return state.token;
|
||||
},
|
||||
getUsername(state: AccountStateInterface): string {
|
||||
return state.username;
|
||||
},
|
||||
isLoggedIn(state: AccountStateInterface): boolean {
|
||||
return state.isLoggedIn;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user