<template>
  <div class="layout-container">
    <Header class="header" />
    <header>
      <div class="center-wrapper">
        <div class="childMenu">
          <router-link :to="item.path" class="child-item" v-for="(item,index) in childMenuList" :key="index">
            {{ item.name }}
          </router-link>
        </div>
      </div>
    </header>
    <div class="space"></div>
    <main class="layout-main">
      <router-view/>
    </main>
    <div class="space"></div>
    <Footer class="footer" />
  </div>

</template>

<style scoped lang="scss">
.childMenu {
  width: 100%;
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  .child-item {
    display: inline-block;
    color: #151515;
    outline: none;
    text-decoration: none;
    font-size: 18px;
    margin-left: 10px;
    margin-right: 10px;
    height: 35px;
    position: relative;
  }

  .router-link-active:after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color:  #151515; // 下划线颜色
    position: absolute;
    bottom: -5px; // 调整下划线与文字的距离
    left: 0;
  }
}
</style>


<script setup lang="ts">
import "@/assets/scss/layout.scss"
import Header from "@/components/common/Header.vue";
import Footer from "@/components/common/Footer.vue";
import {ref} from "vue";
const childMenuList = ref([
  {
    name: '医保目录',
    path: '/social/directory',
  },
  {
    name: '进销存上报',
    path: '/social/inventoryUp',
  },
  {
    name: '收费记录',
    path: '/social/costRecord',
  },
  {
    name: '对账',
    path: '/social/accountRecord',
  }
])
</script>