0.0.2 • Published 6 years ago
csxcom v0.0.2
彩食鲜组件库
组件库基于现项目的util以及antd进行二开用来满足各业务系统的统一的前端展现形式
组件库使用的工具以及环境
- 基于现项目
- 使用antd进行二次开发
- 使用StoryBook进行形式展现
- Enzyme+mocha进行组件测试
- prop-types进行组件传值校验
- 使用FastMock进行数据模拟
组件库设计思想
- 单一性
- 低耦合
- 高复用
- 组件设计应满足较高的可维护性和可拓展性
StoryBook
启动
npm run storybook
参考链接
https://storybook.js.org/docs/addons/introduction/
Enzyme
说明:
测试命令
npm run test
参考链接
https://github.com/airbnb/enzyme/tree/d26ccd412230ab3e4879f6ba643649b968317b49/docs/api
propTypes
You can use prop-types to document the intended types of properties passed to components. React (and potentially other libraries—see the checkPropTypes() reference below) will check props passed to your components against those definitions, and warn in development if they don’t match.
参考链接
FastMock
可根据入参数据动态返回mock内容
参考链接