UNPKG

@ant-design/react-native

Version:

基于蚂蚁金服移动设计规范的 React Native 组件库

18 lines (17 loc) 739 B
import React from 'react'; import { Switch } from 'react-native'; var AntmSwitch = function AntmSwitch(props) { var style = props.style, onChange = props.onChange, _props$checked = props.checked, checked = _props$checked === undefined ? false : _props$checked, _props$disabled = props.disabled, disabled = _props$disabled === undefined ? false : _props$disabled, _props$color = props.color, color = _props$color === undefined ? '#4dd865' : _props$color; return React.createElement(Switch, { style: style, onValueChange: onChange, value: checked, disabled: disabled, trackColor: { 'true': color, 'false': '' } }); }; export default AntmSwitch;