<script lang="ts" setup name="ButtonBox">
import { DefaultProps } from 'element-plus'
import { ref } from 'vue'
const emits = defineEmits(['changeCurrentButton'])
// 按钮菜单
const menu = [
  { name: '待收入', id: 'taking' },
  { name: '已收入', id: 'took' },
  { name: '待归还', id: 'returning' },
  { name: '已归还', id: 'returned' },
  { name: '已超期', id: 'overtime' },
]
const current = ref('taking')
watch(current, (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>

