| | |
| | | /** |
| | | * CSwitchRadio |
| | | * CSwitchRadio 开关式单选框 |
| | | * @author Tevin |
| | | */ |
| | | |
| | |
| | | class="c-switch c-switch-radio" |
| | | :class="className" |
| | | > |
| | | <AtSwitch :title="itemRes.label" /> |
| | | <view class="c-switch-radio-group"> |
| | | <AtSwitch |
| | | :title="itemRes.label" |
| | | ref="switch" |
| | | /> |
| | | <view |
| | | class="c-switch-radio-group" |
| | | ref="radio" |
| | | > |
| | | <view |
| | | class="c-switch-radio-item" |
| | | @tap="evt => handleChange(true)" |
| | |
| | | |
| | | <script> |
| | | import { AtSwitch, AtIcon } from 'taro-ui-vue'; |
| | | import { $ } from '@tarojs/extend'; |
| | | import './cSwitch.scss'; |
| | | |
| | | export default { |
| | |
| | | this.itemRes.onChange(value); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | if (process.env.TARO_ENV === 'h5') { |
| | | $(this.$refs.switch.$el).append(this.$refs.radio.$el); |
| | | } else if (process.env.TARO_ENV === 'weapp') { |
| | | $(this.$refs.switch.$el).find('.at-switch').append(this.$refs.radio); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |