Switch dingtalk only

Switch 开关

代码示例

import { BfSwitch } from '@bud-fe/react-taro-ui';
import { View } from '@tarojs/components';
import React, { useState } from 'react';
export default () => {
const [checked, setChecked] = useState(false);
return (
<>
<View className="group-title">基础用法</View>
<BfSwitch checked={checked} onChange={(v) => setChecked(v)} />
<View className="group-title">自定义文案</View>
<BfSwitch checked yesText="" />
<BfSwitch noText="" />
</>
);
};

API

属性名描述类型默认值
checkedcheckedboolean--
onChangeonChange(checked: boolean) => void--
disableddisabledbooleanfalse
yesTextyesTextstring'是'
noTextnoTextstring'否'
dumi10:24