<!-- tab --> <script lang="ts" setup name="collect/strong"> const props = defineProps({ tablistData: { type: Array, default: () => ([{}] as any), }, }) const emits = defineEmits(['confirm']) const current = ref<string>('') const change = (data: any) => { // 通知父组件 current.value = data console.log() emits('confirm', data) } onMounted(() => { current.value = props.tablistData[0].title emits('confirm', props.tablistData[0].title) }) </script> <template> <!-- tab切换 --> <el-radio-group v-model="current" @change="change"> <el-radio-button v-for="item in props.tablistData" :key="item.id" :label="item.title" /> </el-radio-group> </template> <style lang="scss" scoped> .normal-input { width: 130px !important; } .normal-date { width: 130px !important; } .normal-select { width: 130px !important; } :deep(.el-table__header) { background-color: #bbb; } </style>