2r-button 中文文档教程
2r-button
React 中实现的 2R 库按钮组件。
Instalation
2r-button
可作为 npm 包使用。 只需运行 npm install 2r-button
命令。
要在您的项目中使用它:
import button from '2r-button'; // ES6 syntax
var button = require('2r-button'); // ES5 syntax
Usage & API
可以将以下道具传递给组件:
disabled
(布尔值):按钮是否被禁用(默认为false
)text
(String): 按钮的文本(默认为Button
)classes
(String): 多个类的字符串,以空格分隔(默认to''
)onClick
(Function): 按下按钮时执行的回调函数
Examples
项目中有一个示例文件夹,配置最少。 运行步骤:
克隆项目并
运行
npm install
运行
gulp examples
导航到
http://localhost:5000
License
本软件发布于WTFPL v2.0 许可证的条款。
2r-button
2R library button component implemented in React.
Instalation
2r-button
is available as an npm package. Simply run npm install 2r-button
command.
To use it in your project:
import button from '2r-button'; // ES6 syntax
var button = require('2r-button'); // ES5 syntax
Usage & API
The following props can be passed to the component:
disabled
(Boolean): whether the button is disabled or not (defaults tofalse
)text
(String): the text of the button (defaults toButton
)classes
(String): a string of multiple classes, separated by space (defaults to''
)onClick
(Function): the callback function to be executed when button is pressed
Examples
There is an examples folder inside the project with a minimum config. Steps to run:
Clone the project and
Run
npm install
Run
gulp examples
Navigate to
http://localhost:5000
License
This software is released under the terms of WTFPL v2.0 license.