1,在js中写接口调用
.import request from ‘@/utils/request’
/**
*
- @param {*} getStatistics
- 获取保函生效列表
*/
export function getStatistics(data) {
return request({
url: ‘/collateral/collateralRe/effectiveList’,
method: ‘post’,
data
})
}
2.在vue页面script中引用import { getStatistics, getExpireCount, getHome } from “@/api/statistics”;
data中定义:
listQuery: {
pageSize: 10,
page: 1,
param: {
status: null,
},
},
3.在vue的方法中调用接口返回的取值
methods: {
fetchData() {
this.listLoading = true;
getStatistics(this.listQuery).then((response) => {
this.list = response.data.records;
this.total = response.data.total;
this.listLoading = false;
});
},