import {Module} from 'vuex' import {RootState} from '../index' import { Https } from "@/tool/https"; interface DesignDetail{ clothingType:any, credits:any, // devise:any, // deviseType:any, // system_per:any, // model:any, } const HomeStoreModule : Module = { state:{ clothingType:[], credits:{ value:0 }, }, mutations:{ res_clothingType(state,data){ state.clothingType = data }, setCredits(state,data){ state.credits.value = data }, }, actions:{ get_clothingType(context){ var arr = [{ id:11, name:"nv" },{ id:22, name:"nan", }] context.commit('res_clothingType',arr) // Https.axiosGet(url) // .then((rv: any) => { // context.commit('res_clothingType',rv) // }) // .catch((rv) => { // }); }, getCredits(context){ return new Promise( async (resolve) => { await Https.axiosGet(Https.httpUrls.getCredits,).then((rv) => { context.commit('setCredits',rv) resolve(true) }).catch((res) => { resolve(true) }); }) } } } export default HomeStoreModule