123456789101112131415161718192021222324252627282930313233343536 |
- import Vue from 'vue'
- import Vuex from 'vuex'
- Vue.use(Vuex)
- const store = new Vuex.Store({
- state:{
- userName:'',
- hasLogin:false,
- usingIndex: -1,
- list: []
- },
- getters: {
- usingAddressIndex: (state) => {
- return state.usingIndex
- }
- },
-
- mutations:{
- GET_ADDRESS(state, list) {
- state.list = list
- },
- CHOOSEADDRESS(state, index) {
- state.usingIndex = index
- },
- CLEARCHOOSED(state) {
- state.usingIndex = -1
- },
- DEL(state, index) {
- state.list.splice(index, 1)
- }
- },
- actions: {
- }
- })
- export default store
|