index.vue 746 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <a-form-item class="mb-0">
  3. <a-radio-group v-decorator="decorator">
  4. <a-radio-button
  5. v-for="item in opts"
  6. :value="item.key"
  7. :key="item.key">{{ item.label }}</a-radio-button>
  8. </a-radio-group>
  9. </a-form-item>
  10. </template>
  11. <script>
  12. // description:偏好设置 组件
  13. import { STRATEGY_OPT } from '@Cloudenv/constants/sched'
  14. export default {
  15. name: 'SrategyRadio',
  16. props: {
  17. decorator: {
  18. type: Array,
  19. required: true,
  20. },
  21. isNone: {
  22. type: Boolean,
  23. default: true,
  24. },
  25. },
  26. computed: {
  27. opts () {
  28. const _opts = [...STRATEGY_OPT]
  29. if (!this.isNone) {
  30. return _opts.filter(opt => opt.key)
  31. }
  32. return _opts
  33. },
  34. },
  35. }
  36. </script>