<template>
  <div class="Tow">
    <div class="leftTitle">二级页面</div>

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

    <div class="floorIght">
      <div class="btn" @click="$router.push('/')">去首页</div>
    </div>
    <Search />
  </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("data2.json")
      .then((res) => {
        return res.json();
      })
      .then((data) => {
        this.data = data.filter((v) => v.uid == this.$route.params.id);
      });
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
.Tow {
  background-color: #dbdbdb;
  position: relative;
  .leftTitle {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 20px;
  }

  .floorIght {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 50px;
    display: flex;
    & > div {
      cursor: pointer;
      margin-right: 15px;
      border-radius: 20px;
      height: 40px;
      background-color: #e3e3e3;
      padding: 0 30px;
      line-height: 40px;
    }
  }
}
</style>