AlertformData.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="container-box">
  3. <div class="control-btn">
  4. <div class="btn" :class="{ 'btn-active': activeName === 'default' }" @click="activeName = 'default'">默认数据</div>
  5. <div class="btn" :class="{ 'btn-active': activeName === 'show' }" @click="activeName = 'show'">展示数据</div>
  6. </div>
  7. <Default class="content-box" v-if="activeName === 'default'" />
  8. <Show class="content-box" v-else />
  9. </div>
  10. </template>
  11. <script setup lang="ts">
  12. import { ref } from 'vue';
  13. import Default from './components/default/Default.vue';
  14. import Show from './components/show/Show.vue';
  15. const activeName = ref('default');
  16. </script>
  17. <style scoped lang="scss">
  18. .container-box {
  19. width: 100%;
  20. height: 100%;
  21. display: flex;
  22. flex-direction: column;
  23. min-height: calc(100vh - 90px);
  24. padding: 21px;
  25. background-color: rgba(255, 255, 255, 1);
  26. border-radius: 10px;
  27. }
  28. .control-btn {
  29. display: flex;
  30. margin-bottom: 20px;
  31. .btn {
  32. display: flex;
  33. justify-content: center;
  34. align-items: center;
  35. width: 188px;
  36. height: 38px;
  37. font-size: 14px;
  38. font-weight: 400;
  39. color: rgba(0, 0, 0, 0.88);
  40. border: 1px solid #D9D9D9;
  41. background: rgba(0, 0, 0, 0.02);
  42. cursor: pointer;
  43. }
  44. :first-child {
  45. border-radius: 8px 0px 0px 8px;
  46. }
  47. :last-child {
  48. border-radius: 0px 8px 8px 0px;
  49. }
  50. .btn-active {
  51. font-weight: 500;
  52. color: #1890FF;
  53. border: 1px solid #1890FF;
  54. background-color: rgba(24, 144, 255, 0.15);
  55. }
  56. }
  57. .content-box {
  58. flex: 1;
  59. }
  60. </style>