index.vue 584 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <a-form-item>
  3. <base-select
  4. v-decorator="decorator"
  5. :options="options" />
  6. </a-form-item>
  7. </template>
  8. <script>
  9. import * as R from 'ramda'
  10. import { RESTART_POLICY_OPTS } from '@K8S/constants/index.js'
  11. export default {
  12. name: 'K8SrestartPolicySelect',
  13. props: {
  14. decorator: {
  15. type: Array,
  16. required: true,
  17. },
  18. type: {
  19. type: String,
  20. required: true,
  21. validator: type => R.is(Array, RESTART_POLICY_OPTS[type]),
  22. },
  23. },
  24. data () {
  25. return {
  26. options: RESTART_POLICY_OPTS[this.type],
  27. }
  28. },
  29. }
  30. </script>