0.1.3 • Published 4 years ago

kr-element v0.1.3

Weekly downloads
5
License
MIT
Repository
-
Last release
4 years ago

React 组件库

一、初始化项目

  1. 采用 create-reacta-app 脚手架创建项目
  2. 采用 typescript 开发
  3. 采用 sass 作为样式解决方案
npx create-react-app kr-element --template typescript

1. Eslint代码检测

​ 项目默认开启 eslint 代码检测,但只在控制台显示提示,vscode 中可以安装插件以显示提示信息

2. 添加Sass支持

  1. 下划线开头的文件为局部文件(partial),不会生成单独的 css 文件
yarn add node-sass
  1. 使用 normalize.css 统一样式..

二、组件

1. Button

  1. 添加 button 原生属性;忽略指定的原生属性

    interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLElement>, 'type'> {
      type: 'primary' | 'default' | 'danger' | 'link';
    }
0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago