<script lang="ts" setup name="ButtonBox">
import { ref } from 'vue'
const emits = defineEmits(['changeCurrentButton'])
const menu = [
  { name: '未领用', id: '4' },
  { name: '已领用', id: '5' },
]
const current = ref('4')
watch(current, (newValue) => {
  console.log(newValue)
  emits('changeCurrentButton', newValue)
})
</script>

<template>
  <div class="container">
    <div class="btns">
      <!-- 三级菜单 -->
      <el-radio-group v-model="current">
        <el-radio-button v-for="item in menu" :key="item.id" :label="item.id">
          {{ item.name }}
        </el-radio-button>
      </el-radio-group>
    </div>
    <!-- 展示区域 -->
  </div>
</template>

<style lang="scss" scoped>
.container {
  position: relative;

  .btns {
    position: fixed;
    top: 76px;
    right: 15px;
    z-index: 999;
  }
}
</style>

