<template>
  <div class="top-cats-wall">
    <div
      :class="{
        'wall-item': true,
        'active': current === cat.id
      }"
      v-for="(cat, index) in cats"
      :key="cat.id"
      @click="handleClick(cat.id, index)"
    >
      {{cat.name}}
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopCatsWall',
  props: ['cats', 'current'],
  methods: {
    // 点击分类
    handleClick (id, index) {
      this.$emit('clickCat2', {
        id,
        index
      })
    }
  }
}
</script>

<style lang="scss">
@import './top-cats-wall.scss';
</style>