Skip to content

Commit 27acc9a

Browse files
YunHerryXian Yu
and
Xian Yu
authored
docs(table): ajax demo (#8120)
Co-authored-by: Xian Yu <[email protected]>
1 parent 43ad5de commit 27acc9a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/table/demo/ajax.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ type APIResult = {
7979
}[];
8080
};
8181
82-
const queryData = (params: APIParams) => {
83-
return axios.get<APIResult>('https://randomuser.me/api?noinfo', { params });
82+
const queryData = async (params: APIParams) => {
83+
const res = await axios.get<APIResult>('https://randomuser.me/api?noinfo', { params })
84+
return res.data.results;
8485
};
8586
8687
const {
@@ -90,7 +91,6 @@ const {
9091
current,
9192
pageSize,
9293
} = usePagination(queryData, {
93-
formatResult: res => res.data.results,
9494
pagination: {
9595
currentKey: 'page',
9696
pageSizeKey: 'results',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
"vue-i18n": "^9.1.7",
263263
"vue-infinite-scroll": "^2.0.2",
264264
"vue-loader": "^17.0.0",
265-
"vue-request": "^1.0.2",
265+
"vue-request": "^2.0.4",
266266
"vue-router": "^4.0.0",
267267
"vue-style-loader": "^4.1.2",
268268
"vue-tsc": "^1.0.6",

0 commit comments

Comments
 (0)