<template>
  <div class="Home">
    <div class="leftTitle">首页</div>

    <Main
      :data="data"
      clickPath="/tow/"
      :styleInfo="{ bac: '#fff', borC: 'black',qBac:'#5a5a5a',qColor:'#fff' }"
    />

    <div class="floorIght">
      <div class="btn active">小学语文</div>
      <div class="btn">初中历史</div>
      <Search />
    </div>
  </div>
</template>

<script>
import Search from "../components/Search.vue";
import Main from "../components/Main.vue";

export default {
  components: { Search, Main },
  data() {
    return {
      data: [],
    };
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {
    fetch("data1.json")
      .then((res) => {
        return res.json();
      })
      .then((data) => {
        this.data = data;
      });
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
.Home {
  background-color: #eaeaea;
  position: relative;
  .leftTitle {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 20px;
  }

  .floorIght {
    position: absolute;
    right: 20px;
    bottom: 50px;
    display: flex;
    padding-right: 50px;
    .btn {
      margin-right: 15px;
      border-radius: 20px;
      height: 40px;
      background-color: #e3e3e3;
      padding: 0 30px;
      line-height: 40px;
    }
    .active {
      background-color: #a8a8a8;
      color: #fff;
    }
  }
}
</style>