24jieqi / react-native-xiaoshu

🌈 React Native UI library
https://24jieqi.github.io/react-native-xiaoshu
Apache License 2.0
187 stars 21 forks source link

Switch 的选项可以自定义吗?常规是布尔类型,可以自定义数字1和0或者字符串1和0吗 #35

Closed jiaoxiaoyuan closed 9 months ago

jiaoxiaoyuan commented 9 months ago

Switch 的选项可以自定义吗?常规是布尔类型,可以自定义数字1和0或者字符串1和0吗

onlyling commented 9 months ago
const Demo = () => {
  return (
   // 泛型1 打开时对应的类型
   // 泛型2 关闭时对应的类型
   // 相对简单的数据会自动推导出来的,如果涉及特定值最好手动声明一下
    <Switch<string, string>
      value="打开时对应的值或关闭时对应的值"
      activeValue="打开时对应的值"
      inactiveValue="关闭时对应的值"
    />
  );
};
jiaoxiaoyuan commented 9 months ago

好的,感谢

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: LING_ZI_QING @.> 发送时间: 2023年9月28日 13:41 收件人: hjfruit/react-native-xiaoshu @.> 抄送: NativeBase @.>, Author @.> 主题: Re: [hjfruit/react-native-xiaoshu] Switch 的选项可以自定义吗?常规是布尔类型,可以自定义数字1和0或者字符串1和0吗 (Issue #35)

const Demo = () => { return ( // 泛型1 打开时对应的类型 // 泛型2 关闭时对应的类型 // 相对简单的数据会自动推导出来的,如果涉及特定值最好手动声明一下 <Switch<string, string> value="打开时对应的值或关闭时对应的值" activeValue="打开时对应的值" inactiveValue="关闭时对应的值" /> ); };

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>