| 12345678910111213141516171819202122232425262728 |
- import { View, Switch } from "@tarojs/components";
- import './NewSwitch.scss'
- export default function NewSwitch(props: {
- disable: boolean,
- checked: boolean,
- color: string,
- onChange: any,
- onClick?: any
- }) {
- return <View className="switch_container">
- <Switch checked={props.checked}
- color={props.color}
- onChange={props.onChange}
- />
- {
- props.disable && <View className="switch_top" onClick={(e) => {
- if (process.env.TARO_ENV == 'weapp') {
- e.stopPropagation()
- }
- if (props.onClick) {
- props.onClick()
- }
- }} />
- }
- </View>
- }
|