123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- Vue.use(Vuex);
- const store = new Vuex.Store({
- state: {
- config: {},
- city: '',
- popularity: 0,
-
- citydata: {
- city: "",
- userLocation: '',
- city_id: ''
- },
-
- defaultcity: {
- city: "",
- userLocation: '',
- city_id: ''
- }
- },
- getters: {
- config: state => state.config
- },
- mutations: {
- setconfig(state, data) {
-
- state.config = data
- },
- setcity(state, data) {
-
- state.citydata = data
- },
- setdefaultcity(state, data) {
-
- uni.setStorageSync("city", data)
- state.defaultcity = data
- },
- setpopularity(state, data) {
-
- state.popularity = data
- }
- }
- })
- export default store
|