default.vue 932 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script setup>
  2. const headerBg = ref('#fff')
  3. const router = useRouter()
  4. watch(
  5. () => router.currentRoute.value.path,
  6. (v) => {
  7. if (v === '/')
  8. headerBg.value = '#FAF5F1'
  9. else headerBg.value = '#fff'
  10. },
  11. {
  12. immediate: true,
  13. },
  14. )
  15. </script>
  16. <template>
  17. <div class="common-layout">
  18. <el-container class="h-full">
  19. <!-- <DiscountTip /> -->
  20. <el-header :style="{ backgroundColor: headerBg }" class="pos-relative">
  21. <AppHeader />
  22. <category-header />
  23. </el-header>
  24. <el-main id="app-scroller" class="relative">
  25. <slot />
  26. </el-main>
  27. <!-- <el-footer><AppFooter /></el-footer> -->
  28. <cookie-tip />
  29. </el-container>
  30. </div>
  31. </template>
  32. <style lang="less">
  33. .common-layout {
  34. height: 100vh;
  35. .el-header {
  36. padding-top: 30px;
  37. height: unset;
  38. box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.06);
  39. }
  40. .el-main {
  41. padding: 0px;
  42. }
  43. }
  44. </style>