mirror of
https://github.com/r-ca/kidshift-web.git
synced 2024-10-25 16:34:01 +00:00
mutation実装
This commit is contained in:
parent
381b983cc8
commit
29135b7d3c
|
@ -1,9 +1,15 @@
|
|||
import { MutationTree } from 'vuex';
|
||||
import { ExampleStateInterface } from './state';
|
||||
import { AccountStateInterface } from './state';
|
||||
|
||||
const mutation: MutationTree<ExampleStateInterface> = {
|
||||
someMutation (/* state: ExampleStateInterface */) {
|
||||
// your code
|
||||
const mutation: MutationTree<AccountStateInterface> = {
|
||||
setToken(state: AccountStateInterface, token: string) {
|
||||
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