<template>
  <div class="header">
    <div class="tabs-nav-warp">
      <div class="tabs-nav" scroll-x="true">
        <div class="ul">
          <div class="li" :class="{'on':activeTab===0}" @click="tabChange(0)" v-if="componentContent.firstClassify">{{componentContent.firstClassify}}</div>
          <div class="li" :class="{'on':activeTab===index+beginIndex}" v-for="(item,index) in classifyData" :key="index">
            {{item.categoryName}}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {commonMixin} from '../mixin'
export default {
  mixins: [commonMixin],
  data () {
    return {
      beginIndex:(this.componentContent.firstClassify && this.componentContent.firstClassify.length ) ? 1 : 0,
      activeTab: 0
    }
  }
}
</script>

<style lang="scss" scoped>
  
  .tabs-nav-warp{
    margin-top: 20px;
    padding:0 30px;
    overflow: hidden;
    .tabs-nav{
      .ul{
        display: flex;
        padding-left: 20px;
		      padding-right: 20px;
        .li{
          flex: 1 0 auto;
          margin-left: 5px;
		      margin-right: 5px;
          font-size: 30px;
          color: #252744;
          position: relative;
          padding-bottom: 15px;
          padding-left: 27px;
          padding-right: 27px;
          padding-top: 15px;
          &:first-child{
            margin-left: 0;
          }
          &.on{
            background: #252744;
              box-shadow: 0px 7px 14px 0px #C5C8ED;
              border-radius: 40px;
              color: white;
          }
        }
      }
    }
  }
</style>
