LimitRangeCard.vue 720 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div class="body">
  3. <json-viewer :value="info" theme="jv-light" :expand-depth="depth" class="my-theme"></json-viewer>
  4. </div>
  5. </template>
  6. <script>
  7. import { getLimitRange } from '@/api/limitRange'
  8. export default {
  9. name: 'LimitRangeCard',
  10. props: {
  11. namespace: String
  12. },
  13. data() {
  14. return {
  15. info: {},
  16. depth: 2
  17. }
  18. },
  19. mounted() {
  20. const config = {
  21. params: {
  22. namespace: this.namespace
  23. }
  24. };
  25. getLimitRange(config).then(res => {
  26. this.info = res.data.data
  27. }).catch(err => {
  28. console.log(err)
  29. })
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .body {
  35. width: 95%;
  36. margin: 0 auto;
  37. }
  38. .my-theme {
  39. background: transparent;
  40. }
  41. </style>