Skip to content

remax-component/checkbox

Repository files navigation

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.valuee.target.checked可获取状态
onClick (event: CheckboxEvent) => any onChange

开发

yarn install
yarn watch:example:web

最后用支付宝工具打开example/dist/alipay目录。

image

TODO

  • 单元测试
  • 网页端 Demo

License

MIT

About

Remax checkbox 组件

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published