25 lines
383 B
JavaScript
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
|
|
} |