@lx-react-materiel/mp-radio

0.6.5 • Public • Published

mp-radio

单选框

该组件只能在 ** Taro3 ** 中使用

代码示例

import MpRadio from '@lx-react-materiel/mp-radio';

const Demo = () => {
  const [type, setType] = useState(1);

  const options = [{
    lable: 'AA',
    value: 1,
  }, {
    lable: 'BB',
    value: 2,
  }];
  return (
    <MpRadio
      options={options}
      value={type}
      align="space-around"
      onChange={(v) => setType(v)}
    />
  )
};

API

Props

参数 说明 类型 默认值 必填
options 配置选项 Array<{ label: string value: any disabled?: boolean }> --
value 选中值 any --
color 选中时颜色 string '#1677fe'
align 排列方式 'row' | 'col' | 'space-around 'row'

Events

事件 说明 回调参数
onChange 选择回调 选中的 Radio value

Readme

Keywords

Package Sidebar

Install

npm i @lx-react-materiel/mp-radio

Weekly Downloads

0

Version

0.6.5

License

ISC

Unpacked Size

6.51 kB

Total Files

5

Last publish

Collaborators

  • haiyulu
  • mind29
  • simba.wang
  • owen.huang
  • tiny.tu
  • gweid
  • azumia
  • pok.h
  • jeely
  • tomgou
  • yuki.liu