index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <div class="agri-services" :style="{ height: `calc(100vh - ${tabBarHeight}px - 50px)` }">
  3. <tabs v-model:active="active" class="tabs">
  4. <tab title="农事动态">
  5. <farm-dynamics />
  6. </tab>
  7. <tab title="农资农服大厅">
  8. <services-hall />
  9. </tab>
  10. </tabs>
  11. </div>
  12. </template>
  13. <script setup>
  14. import { ref, computed } from "vue";
  15. import { useStore } from "vuex";
  16. import { Tab, Tabs } from "vant";
  17. import servicesHall from "./components/servicesHall.vue";
  18. import farmDynamics from "./components/farmDynamics.vue";
  19. const store = useStore();
  20. const tabBarHeight = computed(() => store.state.home.tabBarHeight);
  21. const active = ref(0);
  22. </script>
  23. <style lang="scss" scoped>
  24. .agri-services {
  25. width: 100%;
  26. height: 100vh;
  27. .tabs {
  28. ::v-deep {
  29. .van-tabs__wrap {
  30. margin-bottom: 8px;
  31. }
  32. .van-tabs__line {
  33. width: 24px;
  34. height: 4px;
  35. }
  36. .van-tab {
  37. width: 100px;
  38. flex: none;
  39. }
  40. .van-tabs__nav {
  41. justify-content: center;
  42. }
  43. }
  44. }
  45. }
  46. </style>