<template>
  <div class="menus-box">
    <span v-for="(item, index) in menus" :key="index" class="menus-item" :class="currentMenuObj===item?'active':''" @click="menuClick(item)">{{ item.name }}</span>
  </div>
</template>
<script>
export default {
  data() {
    return {
      menus: [
        { name: '首页', active: true }, { name: '优质产品' }, { name: '优质供应商' }, { name: '解决方案与服务' }, { name: '软件系统' }, { name: '专业培训' }, { name: '行业资讯' }, { name: '信息发布' }
      ],
      currentMenuObj: null
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.currentMenuObj = this.menus[0]
    })
  },
  methods: {
    menuClick(item) {
      this.currentMenuObj = item
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.menus-box {
  .menus-item {
    padding: 1px 15px 1px;
    font-size: 20px;
    font-weight: 400;
    font-family: Source Han Sans CN;
    color: #FFFFFF;
    line-height: 48px;
    cursor:pointer;
    user-select: none;
  }
  .menus-item:hover {
    color: #F7601A;
  }
  .active {
    color: #FFFFFF;
    font-weight: 600;
  }
}
</style>
