index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div :style="{ '--current-color': theme }" class="app-wrapper">
  3. <van-nav-bar
  4. :left-arrow="showBackButton"
  5. :title="route.meta.title || '福建水利监管工作平台'"
  6. @click-left="back"
  7. />
  8. <!-- 展示页 -->
  9. <app-main />
  10. <!-- 底部 -->
  11. <bottom-nav />
  12. </div>
  13. </template>
  14. <script setup>
  15. import { computed, ref } from "vue";
  16. import { AppMain, BottomNav } from "@/layout/components/index.js";
  17. import { useRoute, useRouter } from "vue-router";
  18. const router = useRouter();
  19. const route = useRoute();
  20. const theme = ref(localStorage.getItem("theme"));
  21. const showBackButton = computed(() => route.meta.showBack);
  22. function back() {
  23. router.go(-1);
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. .app-wrapper {
  28. height: 100%;
  29. width: 100%;
  30. position: relative;
  31. .app-main {
  32. position: absolute;
  33. top: 0px;
  34. left: 0;
  35. width: 100%;
  36. height: 100%;
  37. background-color: #ebecf0;
  38. }
  39. }
  40. </style>
  41. <style>
  42. .app-wrapper .van-nav-bar__content {
  43. background-color: #007bff;
  44. }
  45. .app-wrapper .van-nav-bar__title {
  46. color: #fff;
  47. }
  48. .app-wrapper .van-nav-bar .van-icon {
  49. color: #fff;
  50. }
  51. </style>