ant-design / pro-components

🏆 Use Ant Design like a Pro!
https://pro-components.antdigital.dev
MIT License
4.04k stars 1.29k forks source link

🐛[BUG] ProList 卡片模式配置 onItem 后会被马上触发 #8269

Closed queee03 closed 1 month ago

queee03 commented 1 month ago

🐛 bug 描述

ProList 卡片模式配置 onItem 后,列表加载时该方法会马上被触发,但点击时不会触发

📷 复现步骤

🏞 期望结果

按照文档,onItem 应该在用户点击对应卡片时才会被触发

💻 复现代码

关键代码:

<ProList
  rowKey="id"
  itemLayout="vertical"
  split={true}
  request={fetchTableData}
  grid={{ column: 2 }}
  metas={metas}
  onItem={(record) => {
    // 列表加载时该方法会马上被触发
    // 但点击时不会触发
    console.log(record);
  }}
/>

© 版本信息

🚑 其他信息

queee03 commented 1 month ago