radio.vue 885 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="row">
  3. <view>
  4. <label for="">{{label}}</label>
  5. </view>
  6. <view >
  7. <radio :value="selectvalue" :checked="checked" color="rgb(100, 142, 184)" style="border-radius:0"/>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name:"radio",
  14. props:{
  15. //值
  16. selectvalue: {
  17. type: String,
  18. required: true,
  19. validator: function (value) {
  20. return value.length>0
  21. }
  22. },
  23. //标签
  24. label: {
  25. type: String,
  26. required: true,
  27. validator: function (value) {
  28. return value.length>0
  29. }
  30. },
  31. checked: {
  32. type: Boolean
  33. },
  34. },
  35. data() {
  36. return {
  37. };
  38. }
  39. }
  40. </script>
  41. <style scoped>
  42. .row{
  43. display: flex;
  44. flex-direction: row;
  45. justify-content: space-between;
  46. width: 100%;
  47. border: 1px solid #eee;
  48. padding: 10px;
  49. margin-top: 10px;
  50. box-sizing: border-box;
  51. }
  52. </style>