<template>
  <div id="app">
    <div class="hello">
      <div class="top">
        <div class="top-left"><img src="../assets/logo.jpg" alt="" class="left-img" />  <div class="txt-box"><div class="left-txt">中国国际经济技术合作促进会</div><div class="left-txt">科技项目转化工作委员会</div></div>  </div>
        <div class="top-right">
          <ul class="top-ul">
            <li
              class="top-li"
              :class="{ active: active == '0' }"
              @click="navto('0', '/')"
            >
              首页
            </li>
            <li
              class="top-li"
              :class="{ active: active == '1' }"
              @click="navto('1', '/explain')"
            >
              委员会简介
            </li>
            <li
              class="top-li"
              :class="{ active: active == '2' }"
              @click="navto('2', '/question')"
            >
              专家智库
            </li>
            <li
              class="top-li"
              :class="{ active: active == '3' }"
              @click="navto('3', '/member')"
            >
              委员会成员
            </li>
            <li
              class="top-li"
              :class="{ active: active == '4' }"
              @click="navto('4', '/About')"
            >
              联系我们
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
export default {
  // props: {
  //   active: {
  //     type: String,
  //     default: "0",
  //   },
  // },
  props:['active'],
  data() {
    return {
      // active: "0",
    };
  },
  methods: {
    navto(id, src) {
      this.$router.push({ path: src });
      this.active = id;
    },
  },
};
</script>

<style lang="scss" scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  line-height: 1;
  .top {
    height: 125px;
    border-bottom: 2px solid #be0000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .top-left{
      width:500px;
    padding-left: 200px;
    display: flex;
    .txt-box{
      width: 400px;
      height: 100%;
      color:#be0000;
      font-size: 26px;
      margin-left: 20px;
      .left-txt{
        // line-height: 30px;
        margin-top: 10px;
        font-weight: 600;
      }
    }
      .left-img{
        width: 80px;
      height: 80px;
      }
    }
    .top-right {
      margin-right: 100px;
      .top-ul {
        display: flex;
        align-items: center;
        width: 700px;

        .top-li {
          list-style: none;
          font-size: 17px;
          font-weight: 500;
          color: #333333;
          padding: 11px 33px;
        }
        .active {
          background: #be0000;
          color: #ffffff;
        }
      }
    }
  }
}
</style>