-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(affix): affix complete🎉 #75
Conversation
src/affix/affix.tsx
Outdated
|
||
static propsType = { | ||
children: Object, | ||
container: Object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看类型应该是 [String, Function]
src/affix/affix.tsx
Outdated
static defaultProps = { container: () => window, offsetBottom: 0, offsetTop: 0 }; | ||
|
||
static propsType = { | ||
children: Object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类型应为[String, Number, Object, Function]
src/affix/affix.tsx
Outdated
static propsType = { | ||
children: Object, | ||
container: Object, | ||
content: Object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同 children
src/affix/affix.tsx
Outdated
innerOffsetTop = signal(0); | ||
|
||
inneroffsetBottom = signal(0); | ||
|
||
innerZIndex = signal(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个被signal的变量并没有在render中使用,直接改成普通变量应该可以实现,signal的话会带来不必要的性能损耗
src/affix/affix.tsx
Outdated
scrollContainer = createRef<ScrollContainerElement>(); | ||
|
||
placeholderEL = createRef<HTMLElement>(); | ||
|
||
ticking = createRef<boolean>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,确认下是否必须要使用ref,直接this.scrollContainer
访问应该可以
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
需要处理下冲突 |
🤔 这个 PR 的性质是?
🔗 相关 Issue
#32
💡 需求背景和解决方案
📝 更新日志
feat(affix): affix complete🎉
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单