<template>
  <nav>
    <ul class="app-tab-nav">
      <li
        v-for="(item, index) in list"
        :key="index"
        :class="{ 'is-active': item.value === active }"
        @click="tabClick(item)"
      >
        <div class="item_name">{{ item.name }}</div>
        <!-- <nuxt-link :to="item.path">{{ item.name }}</nuxt-link> -->
      </li>
    </ul>
  </nav>
</template>

<script>
export default {
  props: { list: { type: Array, default: () => [] }, active: { type: String } },
  data() {
    return {}
  },
  methods: {
    tabClick(item) {
      if (item.path === '/roadmap') {
        window.location.href = '/roadmap'
      } else {
        this.$router.push(item.path)
      }
    }
  }
}
</script>

<style lang="scss">
.app-tab-nav {
  display: flex;
  overflow-x: scroll;
  &::-webkit-scrollbar {
    display: none;
  }
  li {
    margin-left: 0.3rem;
    font-size: 0.14rem;
    line-height: 0.38rem;
    color: #333;
    .item_name {
      white-space: nowrap;
      cursor: pointer;
    }
    &.is-active {
      border-bottom: 0.02rem solid #aa1941;
    }
  }
}
</style>
