import { Module } from 'vuex' ; import { SET_USER } from './actionType' ; export type IUser = Record < 'name' | 'password' , string > ; export interface ILoginState { user : IUser ; } const LoginStore = { namespaced : true , state : { user : { name : '' , password : '' } } , mutations : { [ SET_USER ] ( state , payload ) { state . user = payload ; } } , actions : { [ SET_USER ] ( { commit } , payload ) { commit ( SET_USER , payload ) ; } } } ; export default LoginStore ;