<template>
  <div class="bg-btns">
    <ul>
      <li
        v-for="btn in options"
        :key="btn.value"
        :class="{
          'is-active': modelValue === btn.value,
        }"
        @click="selectBtn(btn)">
        {{ btn.name }}
      </li>
    </ul>
  </div>
</template>

<script setup>
import { reactive, ref,onBeforeMount,toRefs  } from "vue";
const props = defineProps({
  modelValue: {
    type: [String, Number],
    default: 0
  },
  options: {
    type: Array,
    default: () => [],
  }
});
const emit = defineEmits(["update:modelValue"]);

const selectBtn = ({value})=>{
  emit("update:modelValue", value);
};
</script>
