Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(list): add list component #463

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

feaswcy
Copy link

@feaswcy feaswcy commented Aug 16, 2024

fix #394

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

任务清单

  • API功能对齐Mobile Vue端
  • DOM 结构对齐Mobile Vue端
  • 改用 V2文件夹下样式
  • 官网示例代码&&演示示例对齐Mobile Vue端
  • 组件/ 组件示例文件后缀使用 tsx

📝 更新日志

  • fix(组件名称): 处理问题或特性描述 ...

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

src/list/_example/base.jsx Outdated Show resolved Hide resolved
src/list/_example/index.jsx Outdated Show resolved Hide resolved
@liweijie0812
Copy link
Collaborator

冲突了,先合并develop 处理冲突

src/list/list.tsx Outdated Show resolved Hide resolved
src/list/list.tsx Outdated Show resolved Hide resolved
Comment on lines 77 to 87
useEffect(() => {
const scorllParent = getScrollParent(root.current)

scorllParent.addEventListener('scroll', handleScroll);
return () => {
removeEventListener('scroll', handleScroll)
}
}, [height, handleScroll])

return (
<div ref={root} className={`${name}-list`} onScroll={(e)=>handleScroll(e)}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

监听onScrollroot 是同一个,重复监听一个地方了

src/list/list.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Aug 26, 2024

失败

src/list/list.tsx Outdated Show resolved Hide resolved
src/list/list.tsx Outdated Show resolved Hide resolved
}

const List: React.FC<ListProps> = (props) => {
const { classPrefix } = useConfig();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以使用usePrefixClass hooks,可以看看其他组件的写法

@@ -0,0 +1,12 @@
import { useState } from 'react';

const useWindowHeight = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以前的hooks的写法就有问题,你要么直接使用ahooks里的useSize好了,这个hooks删掉?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

【List新组件】任务单
3 participants