<template>
  <div class="tab">
    <div
      class="tab-item"
      :class="modelValue == index ? 'active' : ''"
      v-for="(item, index) in tabs"
      :key="index"
      @click="onClickTab(index)"
    >
      {{ item }}
    </div>
  </div>
</template>

<script setup lang="ts">
// "Regras"
const tabs = ["Relatório", "Minha Referencia"];
const emit = defineEmits(["update:modelValue"]);
const props = defineProps({
  modelValue: { type: Number, default: 0, required: true },
});

function onClickTab(index: number) {
  emit("update:modelValue", index);
}
</script>

<style lang="scss" scoped>
@import "./index.scss";
</style>
