-
Notifications
You must be signed in to change notification settings - Fork 26
feat: add select component #328
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
base: develop
Are you sure you want to change the base?
Conversation
commit: |
src/popup/popup.tsx
Outdated
|
|
||
| install(): void { | ||
| window.addEventListener('resize', this.updatePopper); | ||
| if (this.triggerRef.current) { |
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.
这段测试过生效么?按理说放到installed钩子里才能生效
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.
昨晚推了一个feat: popup添加width监听能力 & 修复authWidth下web components的 宽度问题修改,尝试并验证了这些问题,但不知道为什么它们是同一个cr 但没有显示在 diff 里....
| } | ||
| } | ||
|
|
||
| updateCommonInputProps() { |
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.
这个写法不太符合直觉,用计算属性更好一点
get commonInputProps() {
const { loading, suffixIcon } = this.props;
return {
...pick(this.props, COMMON_PROPERTIES),
suffixIcon: loading ? : suffixIcon,
};
}
| export default class LoadingDemo extends Component { | ||
| options = []; | ||
|
|
||
| loading = false; |
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.
调用this.update()触发响应式不是推荐用法,可以参考下比较新的组件的示例,比如chat-sender里的例子。响应式属性应该用signal()包裹,类似react里的useState,就可以在更新时触发响应式渲染
|
|
||
| import type { SelectContext, TdOptionProps } from '../type'; | ||
|
|
||
| const currentValue = signal(''); |
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.
currentValue和currentOption放到SelectBase的成员变量里吧,标准一点

💡 改动项
t-select和t-option组件和相关测试用例t-fake-arrow这个收起/展开图标的样式问题,及下游组件collapse对它的调用方法loading组件作为输入框后缀图标不能居中的问题popup组件在 visible 时异常闪烁的问题DEVELOP_GUIDE.md中的新增组件部分文档select,popup的 setExportparts 功能input,panel支持容器宽高监听能力,以实现select组件的弹窗宽度和定位跟随功能🤔 这个 PR 的性质是?
🔗 相关 Issue
#11
☑️ 请求合并前的自查清单