mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-26 00:34:01 +00:00
mutation実装
This commit is contained in:
parent
381b983cc8
commit
29135b7d3c
|
@ -1,9 +1,15 @@
|
||||||
import { MutationTree } from 'vuex';
|
import { MutationTree } from 'vuex';
|
||||||
import { ExampleStateInterface } from './state';
|
import { AccountStateInterface } from './state';
|
||||||
|
|
||||||
const mutation: MutationTree<ExampleStateInterface> = {
|
const mutation: MutationTree<AccountStateInterface> = {
|
||||||
someMutation (/* state: ExampleStateInterface */) {
|
setToken(state: AccountStateInterface, token: string) {
|
||||||
// your code
|
state.token = token;
|
||||||
|
},
|
||||||
|
setUsername(state: AccountStateInterface, username: string) {
|
||||||
|
state.username = username;
|
||||||
|
},
|
||||||
|
setLoggedIn(state: AccountStateInterface, isLoggedIn: boolean) {
|
||||||
|
state.isLoggedIn = isLoggedIn;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user