leaky.js 672 Bytes
Newer Older
neogcg's avatar
neogcg committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import { leakyCablelist } from "../../views/setting/api"
const state = {
    list: [],
    pageNum:1,
    pageSize:10,
}
const mutations = {
    changeList(state, arr) {
        state.list = arr
    },
}
const actions = {
    asyncList(context) {
        leakyCablelist( {
            current: context.state.pageNum,
            size: context.state.pageSize,
          }).then(res => {
        
        let arr = res.records?res.records:[]
     
            context.commit("changeList", arr)
        })
    }
}
const getters = {
    list(state) {
        return state.list
    }
}
export default {
    state,
    mutations,
    actions,
    getters,
    namespaced: true
}