@remax-component/checkbox
v0.0.2
Published
checkbox UI for Remax
Downloads
4
Readme
rmc-checkbox
Remax 的单选框组件
安装
yarn add @remax-component/checkbox
# 或者
npm i @remax-component/checkbox
使用
import "rmc-checkbox/dist/assets/index.css"; // 亦可引入其它样式
import { View } from "remax/one";
import Checkbox from "rmc-checkbox";
export default () => {
return (
<View>
<Checkbox />
</View>
);
};
API
| 名称 | 类型 | 默认值 | 描述 |
| -------------- | ------------------------------- | ------ | --------------------------------------------------------------------------- |
| prefixCls | string | | rmc-checkbox |
| className | string | | 为根节点添加的额外类名 |
| name | string | | 用于原生的 Form 的表单字段 |
| checked | boolean | | 是否被选中(受控属性) |
| defaultChecked | boolean | | 是否默认被选中,当且仅当组件被挂载时生效 |
| onChange | (event: CheckboxEvent) => any
| | Checkbox 值改变时被调用,通过e.target.value
和e.target.checked
可获取状态 |
| onClick | (event: CheckboxEvent) => any
| | 同onChange
|
开发
yarn install
yarn watch:example:web
最后用支付宝工具打开example/dist/alipay
目录。
TODO
- [x] 单元测试
- [ ] 网页端 Demo
License
MIT