railWay.js 665 Bytes
import { railWaylist } from "../../views/setting/api"
const state = {
    list: [],
    pageNum:1,
    pageSize:10,
}
const mutations = {
    changeList(state, arr) {
        state.list = arr
    }
}
const actions = {
    asyncList(context) {
        railWaylist( {
            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
}