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