[RFC] New Component: QrCode #38857
MadCcc
announced in
RFCs - archive
Replies: 4 comments 3 replies
-
建议支持 添加二维码文字描述 中间或二维码下边 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
新增 QrCode 组件,能够将链接转换生成二维码,支持自定义配色和 Logo 配置。
API
#FFFFFF
#000000
'L' | 'M' | 'Q' | 'H'
'L'
Basic Example
基本用法
有 LOGO
Advanced Usage
Popover
Detailed Design
基础样式
最基本的二维码,为了与5.0整体风格一致,二维码会带有一个白色背景:
二维码尺寸:140 * 140px
白色背景:160 * 160px,radius=8px
自定义Logo
支持在二维码中心区域显示品牌Logo,Logo区白色背景:40*40px,radius=6px
这个可以考虑自行实现了,支持 ReactNode
二维码状态
二维码过期,支持点击刷新;刷新时会有短暂的loading动画。
没有 onRefresh 时不显示“点击刷新”。
代码重构
在旧代码基础上重构,分支:https://github.com/ant-design/ant-design/tree/feat/QrCode
需要做的迁移工作包括但不限于:
genComponentStyleHook
,减少 hashId 的使用,token 调整;useMergedState
受控等;Drawbacks
暂无。
Beta Was this translation helpful? Give feedback.
All reactions