kboss/f/staticPage/src/store/weather.js
2025-07-16 14:27:17 +08:00

25 lines
383 B
JavaScript

import {reqWeather} from "@/api";
const state ={
weatherObj:{}
}
const mutations={
Weather(state,weatherObj){
state.weatherObj=weatherObj
}
}
const actions = {
async getWeather({commit}){
let result = await reqWeather();
commit("Weather",result)
}
}
const getters={}
export default {
state,
mutations,
actions,
getters
}