fxzstmain.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="health">
  3. <div class="selections mg-b-16">
  4. <div class="item" @click="tabSelect(0)" :class="{ active: tabIndex == 0 }">风向走势情况</div>
  5. <div class="item" @click="tabSelect(1)" :class="{ active: tabIndex == 1 }">风资源玫瑰图</div>
  6. </div>
  7. <div class="curHeight" v-if="tabIndex == 0">
  8. <Tab1 />
  9. </div>
  10. <div class="curHeight" v-if="tabIndex == 1">
  11. <Tab2 />
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import Tab1 from "./fxzstab1.vue";
  17. import Tab2 from "./fxzstab2.vue";
  18. export default {
  19. // 名称
  20. name: "wtSaturability",
  21. // 使用组件
  22. components: {
  23. Tab1,
  24. Tab2,
  25. },
  26. // 数据
  27. data () {
  28. const that = this;
  29. return {
  30. tabIndex: 0,
  31. };
  32. },
  33. // 函数
  34. methods: {
  35. tabSelect (state) {
  36. this.tabIndex = state;
  37. },
  38. // 请求服务
  39. requestData () {
  40. }
  41. },
  42. created () {
  43. this.requestData();
  44. },
  45. mounted () { },
  46. unmounted () { },
  47. };
  48. </script>
  49. <style lang="less" scope>
  50. .health {
  51. .selections {
  52. display: flex;
  53. .item {
  54. flex: 0 0 128px;
  55. text-align: center;
  56. line-height: 33px;
  57. margin-right: 8px;
  58. color: @font-color;
  59. font-size: @fontsize-s;
  60. background: fade(@gray, 20);
  61. border: 1px solid fade(@gray, 20);
  62. &:hover,
  63. &.active {
  64. background: fade(@green, 20);
  65. border: 1px solid @green;
  66. color: @green;
  67. cursor: pointer;
  68. }
  69. }
  70. }
  71. .curHeight {
  72. height: 87vh;
  73. }
  74. }
  75. </style>