<script setup>
const headerBg = ref('#fff')
const router = useRouter()

watch(
  () => router.currentRoute.value.path,
  (v) => {
    if (v === '/')
      headerBg.value = '#0F0820'
    else headerBg.value = '#fff'
  },
  {
    immediate: true,
  },
)
</script>

<template>
  <div class="common-layout">
    <el-container class="h-full">
      <!-- <el-header :style="{ backgroundColor: headerBg }" class="pos-relative">
        <AppHeader />
        <category-header />
      </el-header> -->
      <el-main id="app-scroller" class="relative">
        <AppHeader />
        <slot />
      </el-main>
      <!-- <el-footer><AppFooter /></el-footer> -->
    </el-container>
  </div>
</template>

<style lang="less">
.common-layout {
  height: 100vh;

  .el-header {
    padding-top: 30px;
    height: unset;
    box-shadow: 0px 3px 6px 1px rgba(0, 0, 0, 0.06);
  }

  .el-main {
    padding: 0px;
  }
}
</style>
