<template>
  <div class="ww100 model_box pl10 pr20 pl20">
    <MOSTY.Assort :title="props.title">
      <template #btn>
        <div class="tabs flex pointer">
          <span v-for="(item,index) in props.tabs" :key="item" :class="{isactive:selectIndex === index}" @click="onClick(index,item.value)">{{ item.label }}</span>
        </div>
      </template>
    </MOSTY.Assort>
    <div :style="{height:props.height}" class="pie_model_box">
      <!-- <div class="radio_box">
        <slot name="left">
          <span></span>
        </slot>

      </div> -->
      <slot />
    </div>
  </div>
</template>

<script setup>
import { defineProps, ref, defineEmits } from "vue";
import * as MOSTY from "@/components/MyComponents/index";
const props = defineProps({
  title: String,
  height: String,
  tabs: Array,
})
const selectIndex = ref(0)
const emits = defineEmits(["change"])
const onClick = (index, value) => {
  selectIndex.value = index
  emits("change", value)
}
</script>

<style lang="scss" scoped>
.radio_box {
  color: #000;
  z-index: 10;
  display: flex;
  cursor: pointer;
  justify-content: space-between;
}
.tabs {
  & > span {
    padding: 5px 10px;
    background: #f2f2f2;
    border-radius: 3px;
    margin-left: 10px;
    color: #000;
  }
  .isactive {
    color: #ffff;
    background: var(--el-color-primary);
  }
}
</style>
