Files
ClassContent/历届学生/fontendseven/项目练习/上课项目/uniapp-pte/store/modules/car.js
2024-09-27 02:06:13 +08:00

24 lines
610 B
JavaScript

import carService from '../../service/carService'
export default {
state: {
carList: []
},
mutations: {
SET_CARLIST (state, data) {
state.carList = data
}
},
actions: {
async getCarList({ commit }) {
let res = await (new carService()).getCarList();
console.log("actions getCarList ===: ", res)
commit("SET_CARLIST", res)
},
async addCar({ commit }, params) {
let res = await (new carService()).addCar(params);
console.log("actions addCar ===: ", res)
}
}
}