Skip to content

Commit

Permalink
fix(projects): fix table row-key ts type
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Mar 16, 2024
1 parent 03c2f3a commit 0cc8f05
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/views/manage/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ async function handleDelete(id: number) {
getData();
}
function getRowKey(row: Api.SystemManage.Menu) {
return row.id;
}
</script>

<template>
Expand All @@ -246,8 +250,9 @@ async function handleDelete(id: number) {
:flex-height="!appStore.isMobile"
:scroll-x="1088"
:loading="loading"
:row-key="getRowKey"
remote
:pagination="pagination"
:row-key="item => item.id"
class="sm:h-full"
/>
<MenuOperateDrawer
Expand Down
6 changes: 5 additions & 1 deletion src/views/manage/role/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ function getIndex(index: number) {
return String((page - 1) * pageSize + index + 1);
}
function getRowKey(row: Api.SystemManage.User) {
return row.id;
}
</script>

<template>
Expand All @@ -207,8 +211,8 @@ function getIndex(index: number) {
:scroll-x="702"
:loading="loading"
remote
:row-key="getRowKey"
:pagination="mobilePagination"
:row-key="item => item.id"
class="sm:h-full"
/>
<RoleOperateDrawer
Expand Down
6 changes: 5 additions & 1 deletion src/views/manage/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ function getIndex(index: number) {
return String((page - 1) * pageSize + index + 1);
}
function getRowKey(row: Api.SystemManage.User) {
return row.id;
}
</script>

<template>
Expand All @@ -237,8 +241,8 @@ function getIndex(index: number) {
:scroll-x="962"
:loading="loading"
remote
:row-key="getRowKey"
:pagination="mobilePagination"
:row-key="item => item.id"
class="sm:h-full"
/>
<UserOperateDrawer
Expand Down

0 comments on commit 0cc8f05

Please sign in to comment.