index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div>
  3. <page-header :title="$t('common_631')" :tabs="tabs" :current-tab.sync="currentComponent" />
  4. <page-body>
  5. <keep-alive>
  6. <component :is="currentComponent" :id="currentComponent" />
  7. </keep-alive>
  8. </page-body>
  9. </div>
  10. </template>
  11. <script>
  12. import AccessKeyList from './components/AccessKeyList'
  13. import ContainerSecretList from '../container-secret/components/List'
  14. import ContainerImageSecretList from '../container-image-secret/components/List'
  15. export default {
  16. name: 'CredentialIndex',
  17. components: {
  18. AccessKeyList,
  19. ContainerSecretList,
  20. ContainerImageSecretList,
  21. },
  22. data () {
  23. const type = this.$route.query.type
  24. let currentComponent = 'AccessKeyList'
  25. if (type === 'container_image') {
  26. currentComponent = 'ContainerImageSecretList'
  27. } else if (type === 'container_secret') {
  28. currentComponent = 'ContainerSecretList'
  29. }
  30. return {
  31. currentComponent,
  32. tabs: [
  33. {
  34. key: 'AccessKeyList',
  35. label: this.$t('scope.text_4'),
  36. },
  37. {
  38. key: 'ContainerImageSecretList',
  39. label: this.$t('common.container_image_secret'),
  40. },
  41. {
  42. key: 'ContainerSecretList',
  43. label: this.$t('common.container_secret'),
  44. },
  45. ],
  46. }
  47. },
  48. }
  49. </script>