<template>
  <view class="radio_tabs_content">
    <view
      v-for="(i, index) in typeEnums"
      :key="`item_${index}`"
      :class="`readio_items ${selectEd === i?.value ? 'active' : ''}`"
      @click="handleSelect(i)"
    >
      {{ i?.text }}
    </view>
  </view>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
const props = defineProps(['Enums'])
const typeEnums = ref<any>([])
const selectEd = ref('BankLoan')
const emit = defineEmits(['change'])
const handleSelect = (e: any) => {
  selectEd.value = e.value
  emit('change', e.value)
}

onMounted(() => {
  const LoansBizTypeEnumArray = Object.values(props.Enums)
  typeEnums.value = LoansBizTypeEnumArray
  console.log(props.Enums)
})
</script>

<style lang="scss" scoped>
.radio_tabs_content {
  background-color: #fff;
  border: 1px solid #325a9e;
  margin: 0 30rpx;
  border-radius: 15rpx;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  font-size: 27rpx;
  color: #325a9e;
  .readio_items {
    padding: 15rpx 30rpx;
    border-radius: 15rpx;
  }
  .active {
    background-color: #325a9e;
    color: #fff;
  }
}
</style>
