ModeSelect.vue 751 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <a-form-item :label="$t('compute.text_827')">
  3. <a-radio-group v-decorator="decorators.mode">
  4. <template v-for="(item, key) of modes">
  5. <a-radio-button :value="key" :key="key" v-if="!ignores.includes(key)">{{ item }}</a-radio-button>
  6. </template>
  7. </a-radio-group>
  8. </a-form-item>
  9. </template>
  10. <script>
  11. import * as R from 'ramda'
  12. export default {
  13. name: 'ModeSelect',
  14. props: {
  15. ignoreMode: [String, Array],
  16. decorators: {
  17. type: Object,
  18. required: true,
  19. },
  20. },
  21. data () {
  22. return {
  23. modes: this.$t('physicalmachineAddModes'),
  24. }
  25. },
  26. computed: {
  27. ignores () {
  28. return R.is(String, this.ignoreMode) ? [this.ignoreMode] : (this.ignoreMode || [])
  29. },
  30. },
  31. }
  32. </script>