You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
876 B

  1. <template>
  2. <view :class="className" :style="style" class="cu-form-group">
  3. <view class="title">
  4. <text v-if="required" class="lr-required">*</text>
  5. {{ title }}
  6. </view>
  7. <radio
  8. @change="change"
  9. :class="[isCheck ? 'checked' : '', color ? color : '', point ? 'radio' : '']"
  10. :checked="isCheck"
  11. :value="radioValue"
  12. :disabled="disabled"
  13. ></radio>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'l-radio',
  19. props: {
  20. title: {},
  21. disabled: {},
  22. point: {},
  23. color: {},
  24. radioValue: {},
  25. value: {},
  26. required: {}
  27. },
  28. methods: {
  29. change(e) {
  30. if (e.detail.value) {
  31. this.$emit('input', this.radioValue)
  32. this.$emit('change', this.radioValue)
  33. }
  34. }
  35. },
  36. computed: {
  37. isCheck() {
  38. return this.value && this.value == this.radioValue
  39. }
  40. }
  41. }
  42. </script>