-
Notifications
You must be signed in to change notification settings - Fork 63
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(radio): 重构radio dom接口,补充对应文档和适配样式 #468
base: develop
Are you sure you want to change the base?
Conversation
382d560
to
fa6d0ab
Compare
fa6d0ab
to
89ddd3d
Compare
@@ -1,4 +1,2 @@ | |||
import '../../_common/style/mobile/components/radio/_index.less'; | |||
import '../../_common/style/mobile/components/radio/v2/_index.less'; | |||
import '../../_common/style/mobile/components/radio-group/_index.less'; |
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.
radio-group 的样式没有实际意义了,可移除
allowUncheck = false, | ||
checked = false, | ||
defaultChecked = false, | ||
children, |
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 需要保留。 type.ts文件缺少了该属性,辛苦重新从api平台生成
import classNames from 'classnames'; | ||
import { CheckIcon } from 'tdesign-icons-react'; | ||
import { CheckIcon, CheckCircleFilledIcon } from 'tdesign-icons-react'; | ||
import forwardRefWithStatics from '../_util/forwardRefWithStatics'; | ||
import useConfig from '../_util/useConfig'; |
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.
改用 usePrefixClass() 计算组件类名前缀
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.
const radioClass = usePrefixClass('radio');
{content && ( | ||
<div | ||
className={`${classPrefix}__description ${disabled && `${classPrefix}__description--disabled`}`} | ||
style={getLimitRow(maxContentRow)} |
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.
同上
<div className={iconClass}>{renderIcon()}</div> | ||
<div className={`${classPrefix}__content`}> | ||
{label && ( | ||
<span className={titleClassName} style={labelStyle}> |
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.
style={{ WebkitLineClamp: maxLabelRow }} 就好, 其他的在样式文件里面处理了
> | ||
<CheckIcon size={16} /> | ||
</div> | ||
); | ||
}; | ||
|
||
const labelStyle = { |
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.
实际未使用代码记得移除
@@ -18,12 +18,23 @@ export interface TdRadioProps { | |||
* @default false | |||
*/ | |||
allowUncheck?: 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.
allowUncheck 属性功能未实现,需要补充实现
* 是否允许取消选中 | ||
* @default false | ||
*/ | ||
allowUncheck?: 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.
radio-group的allowUncheck属性功能也未实现,需要补齐
@byq1213 API文档需要从tdesign-api平台重新生成,补充了 readonly 属性 |
fix #461
🤔 这个 PR 的性质是?
🔗 相关 Issue
fix #461
💡 需求背景和解决方案
📝 更新日志
fix(组件名称): 处理问题或特性描述 ...
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单