Skip to content

Commit 4158a72

Browse files
committed
feat(projects): update
1 parent 8630175 commit 4158a72

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/hooks/common/naive-table.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ export function getNaiveTableIndex(pagination: PaginationProps, index: number) {
221221
return (page - 1) * pageSize + index + 1;
222222
}
223223

224-
export function getNaiveTableRowKey<T extends TableData>(row: T) {
225-
return row.id;
226-
}
227-
228224
function isTableColumnHasKey<T>(column: TableColumn<T>): column is NaiveUI.TableColumnWithKey<T> {
229225
return Boolean((column as NaiveUI.TableColumnWithKey<T>).key);
230226
}

src/views/manage/user/index2.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ import { fetchGetUserList } from '@/service/api';
44
import { $t } from '@/locales';
55
import { useAppStore } from '@/store/modules/app';
66
import { enableStatusRecord, userGenderRecord } from '@/constants/business';
7-
import {
8-
getNaiveTableIndex,
9-
getNaiveTableRowKey,
10-
useNaiveTable,
11-
useNaiveTableOperate
12-
} from '@/hooks/common/naive-table';
7+
import { getNaiveTableIndex, useNaiveTable, useNaiveTableOperate } from '@/hooks/common/naive-table';
138
import UserOperateDrawer from './modules/user-operate-drawer.vue';
149
import UserSearch from './modules/user-search.vue';
1510
@@ -178,7 +173,7 @@ function edit(id: number) {
178173
:scroll-x="962"
179174
:loading="loading"
180175
remote
181-
:row-key="getNaiveTableRowKey"
176+
:row-key="row => row.id"
182177
:pagination="mobilePagination"
183178
class="sm:h-full"
184179
/>

0 commit comments

Comments
 (0)