index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <QStemplate :title="title" :titleHide="titleHide" :fontSize="fontSize" :width="width" :titleFlex="titleFlex"
  3. :contentFlex="contentFlex" :titleStyle="titleStyle" :contentStyle="contentStyle" :required="required" :requiredSign="requiredSign"
  4. :layout="layout" :titleLayout="titleLayout" :itemDisabled="itemDisabled" :titleColor="titleColor">
  5. <view class="flex_row_none_c width100 padding_10rpx_15rpx">
  6. <radio-group @change="radioChange" class="width100 wrap" :class="itemLayout_computed">
  7. <label class="fontColor666666 flex_row_none_c marginRight_15rpx padding_10rpx" v-for="(radioItem, radioIndex) in itemArray||[]"
  8. :key="radioIndex">
  9. <radio :value="radioItem.value" :checked="value==String(radioItem.value)" :disabled="disabled" :color="radioItem.color||color"
  10. :style="'transform: scale(' + (scale||'.8') + ');'" />
  11. <view class="flex_row_none_c">{{radioItem.name}}</view>
  12. </label>
  13. </radio-group>
  14. </view>
  15. </QStemplate>
  16. </template>
  17. <script>
  18. import _app from '../../js/app.js';
  19. import QStemplate from '../../template/template.vue';
  20. import QSInputsMixin from '../../js/QSInputsMixin.js';
  21. export default {
  22. components: {
  23. QStemplate
  24. },
  25. props: {
  26. itemArray: {
  27. type: Array,
  28. default () {
  29. return []
  30. }
  31. },
  32. color: {
  33. type: String,
  34. default: '#33cc33'
  35. },
  36. scale: {
  37. type: String,
  38. default: '.8'
  39. },
  40. disabled: {
  41. type: Boolean,
  42. default: false
  43. }
  44. },
  45. methods: {
  46. radioChange({
  47. detail: {
  48. value
  49. }
  50. }) {
  51. this.setValue(value);
  52. }
  53. },
  54. mixins: [QSInputsMixin({
  55. QSInputsType: _app.typeObj.radio
  56. })]
  57. };
  58. </script>
  59. <style scoped>
  60. @import url("../../css/inputs.css");
  61. </style>