Skip to content

Commit

Permalink
在项目表格中添加行点击事件以启用项目开放
Browse files Browse the repository at this point in the history
实现了在项目表格中点击行时,触发openProject方法的功能。该方法现在通过记录的id属性来打开相应的项目。
  • Loading branch information
www.zerocode.net.cn committed Sep 17, 2024
1 parent cc9fb44 commit 528a5d7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pages/dataModels/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export default () => {
],
}}
rowKey="id"
onRow={(record) => ({
onClick: () => openProject(record),
style: { cursor: 'pointer' },
})}
dataSource={state.projects}
pagination={{
pageSize: state.limit,
Expand All @@ -150,9 +154,7 @@ export default () => {
title: {
dataIndex: 'projectName',
title: '项目名称',
render: (text, record) => (
<a onClick={() => openProject(record)}>{text}</a>
),
render: (text) => <a>{text}</a>,
},
avatar: {
dataIndex: 'avatar',
Expand Down

0 comments on commit 528a5d7

Please sign in to comment.