<template>
  <rt-tabs v-model="tabValue" :tabList="tabList" :type="'false'">
    <template slot-scope="scope">
      <div
        class="tab-item"
        :class="{'active':scope.item.value===tabValue}"
        @click="tabChange(scope.item.value)"
      >{{scope.item.name}}</div>
    </template>
  </rt-tabs>
</template>

<script>
export default {
  name: 'rtTabs2',
  model: {
    prop: 'tabValue'
  },
  props: {
    tabList: {
      type: Array
    }
  },
  data() {
    return {
      tabValue: 0
    };
  },
  methods: {
    tabChange(val) {
      this.tabValue = val;
      this.$emit('input', val);
    }
  }
};
</script>

<style lang="less" scoped>
.tab-item {
  width: 56px;
  height: 28px;
  border: 1px solid #b4bdcf;
  border-radius: 14px;
  line-height: 28px;
  font-size: 12px;
  color: #555555;
  text-align: center;
  margin: 10px 5px;
  display: inline-block;
}
.active {
  background: #53a4fc;
  color: #ffffff;
  border: 1px solid #53a4fc;
}
/deep/ .rt-tabs-header .rt-tabs .rt-tabs-content {
  display: block;
  height: auto;
  white-space: nowrap;
  ::after {
    border-top: 0;
  }
}
/deep/ .rt-tabs-header .rt-tabs {
  overflow-x: scroll;
  width: 100%;
  .rt-tabs-content-border::after {
    border-top: 0;
  }
}
</style>