0.1.3 • Published 5 years ago
kr-element v0.1.3
React 组件库
一、初始化项目
- 采用
create-reacta-app脚手架创建项目- 采用
typescript开发- 采用
sass作为样式解决方案
npx create-react-app kr-element --template typescript1. Eslint代码检测
项目默认开启 eslint 代码检测,但只在控制台显示提示,vscode 中可以安装插件以显示提示信息
2. 添加Sass支持
- 下划线开头的文件为局部文件(partial),不会生成单独的
css文件
yarn add node-sass- 使用 normalize.css 统一样式..
二、组件
1. Button
添加
button原生属性;忽略指定的原生属性interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLElement>, 'type'> { type: 'primary' | 'default' | 'danger' | 'link'; }