江西小程序管理端
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.

49 lines
769 B

1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view class="radioBox">
  3. <u-radio-group
  4. v-model="value"
  5. placement="row"
  6. size="14"
  7. >
  8. <u-radio
  9. :customStyle="{marginLeft: '8px'}"
  10. v-for="(item, index) in radioData"
  11. :key="index"
  12. :label="item.name"
  13. :name="item.id"
  14. labelSize="14"
  15. @change="changeRadio"
  16. >
  17. </u-radio>
  18. </u-radio-group>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. radioData: {
  25. type: Array,
  26. default: []
  27. }
  28. },
  29. data() {
  30. return {
  31. value: ''
  32. }
  33. },
  34. mounted() {
  35. this.$on('upDateRadio',(val)=>{
  36. this.value = val
  37. })
  38. },
  39. methods: {
  40. changeRadio(val) {
  41. // console.log(this.value)
  42. this.$emit('changeRadio', val)
  43. }
  44. }
  45. }
  46. </script>
  47. <style>
  48. </style>