hug-sun / hugsun-ui Goto Github PK
View Code? Open in Web Editor NEW基于dumi搭建的react组件库
Home Page: https://hug-sun.github.io/hugSun-UI/
基于dumi搭建的react组件库
Home Page: https://hug-sun.github.io/hugSun-UI/
现在开发过程中需要先锁定版本
已经上传yarn.lock
文件 需使用yarn进行依赖安装保证版本统一
后续会排查由哪个依赖引起问题
现在暂时只有List遇到了这个问题 由于List组件本身同时要支持拥有一个子组件+ref
所以需要由基本类型标注方法
React.FC<IComponentPropsType>
改为
React.FC<IComponentPropsType & React.RefAttributes<HTMLElement>> & { Item?: typeof ChildComponent }
此段类型为 React.FC<IComponentPropsType & React.RefAttributes<HTMLElement>>
用于标注React函数式组件类型
同时内部IComponentPropsType & React.RefAttributes<HTMLElement>
为组件props类型 + 对应ref类型
后半段{ Item?: typeof ChildComponent }
为对应子组件类型 如果遇到类似的操作可以考虑这种用法
但是同时子组件无法直接使用 因为此段子组件只能为可选属性 否则组件本身类型报错
此时有两种情况
const { Item } = List;
const MenuItem = Item as typeof ListItem
const Item = List.Item as typeof ListItem
暂时只有这种解决方案 如有更好方案欢迎在此issue下交流
组件库主页面当前没有比较好的设计想法
如果有相关提议可以在此issue下讨论交流
dumi提供的自动生成文档API暂时有一些小bug
如果需要某个组件本身需要多API 需要考虑下述方法进行使用
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.