{"size": 1577, "ext": "js", "max_stars_repo_path": "src/store/index.js", "max_stars_repo_name": "lzy170717/vue", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/store/index.js", "max_issues_repo_name": "lzy170717/vue", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/store/index.js", "max_forks_repo_name": "lzy170717/vue", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2833333333, "max_line_length": 71, "alphanum_fraction": 0.5129993659}
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        "city": "南京",
        "number": "1",
        "newCity": (localStorage.length ? localStorage.newCity : "北京"),
        "flag": false,
        "inputSearch": '',
        "flag": false,
        "isPop": false,
        "isFadeIn": false,
        "isblock": false,
        "isfixbooking": true
    },
    mutations: {
        changeCity: function(state, payload) {
            state.city = payload.city;
            this.$store.commit("changeCity");
        },
        changePageNum: function(state, payload) {
            state.number = payload.pageNum;
        },
        changeCurrentCity: function(state, newLoad) {
            state.newCity = newLoad.city;
        },
        switchData: function(state, flag) {
            state.flag = flag;
        },
        changeInputSearch: function(state, value) {
            state.inputSearch = value;
        },
        switchData: function(state, flag) {
            state.flag = flag;
        },
        changeIsPop: function(state) {
            state.isPop = !state.isPop;
        },
        changeIsFadeIn: function(state) {
            state.isFadeIn = !state.isFadeIn;
        },
        changeIsBlock: function(state) {
            state.isblock = !state.isblock;
        },
        changeIsFixBooking: function(state) {
            state.isfixbooking = !state.isfixbooking;
        }
    },
    getters: {
        "perfectCity": function(state) {
            return state.city + "^<>^"
        }

    }
})

