mutation実装

This commit is contained in:
rca 2024-07-18 23:07:27 +09:00
parent 381b983cc8
commit 29135b7d3c

View File

@ -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;
} }
}; };