docs(table): ajax 示例文档

pull/8120/head
Xian Yu 2025-04-10 14:40:09 +08:00
parent aa211fd789
commit d0c6174028
2 changed files with 4 additions and 4 deletions

View File

@ -79,8 +79,9 @@ type APIResult = {
}[];
};
const queryData = (params: APIParams) => {
return axios.get<APIResult>('https://randomuser.me/api?noinfo', { params });
const queryData = async (params: APIParams) => {
const res = await axios.get<APIResult>('https://randomuser.me/api?noinfo', { params })
return res.data.results;
};
const {
@ -90,7 +91,6 @@ const {
current,
pageSize,
} = usePagination(queryData, {
formatResult: res => res.data.results,
pagination: {
currentKey: 'page',
pageSizeKey: 'results',

View File

@ -262,7 +262,7 @@
"vue-i18n": "^9.1.7",
"vue-infinite-scroll": "^2.0.2",
"vue-loader": "^17.0.0",
"vue-request": "^1.0.2",
"vue-request": "^2.0.4",
"vue-router": "^4.0.0",
"vue-style-loader": "^4.1.2",
"vue-tsc": "^1.0.6",