WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 91ef36b

Browse files
committed
fix: update sortDirection emission to handle undefined values correctly
1 parent a80bc27 commit 91ef36b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adminforth/spa/src/afcl/Table.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
if (currentPage.value !== 1) currentPage.value = 1;
209209
refresh();
210210
emit('update:sortField', currentSortField.value);
211-
emit('update:sortDirection', currentSortField.value ? currentSortDirection.value : undefined as any);
211+
emit('update:sortDirection', currentSortField.value ? currentSortDirection.value : undefined);
212212
emit('sort-change', { field: currentSortField.value, direction: currentSortDirection.value });
213213
});
214214
@@ -269,7 +269,7 @@
269269
offset: (currentLoadingIndex - 1) * props.pageSize,
270270
limit: props.pageSize,
271271
sortField: currentSortField.value,
272-
sortDirection: currentSortDirection.value,
272+
...(currentSortField.value ? { sortDirection: currentSortDirection.value } : {}),
273273
});
274274
isAtLeastOneLoading.value[currentLoadingIndex] = false;
275275
if (isAtLeastOneLoading.value.every(v => v === false)) {

0 commit comments

Comments
 (0)