diff --git a/packages/fighting-design/tabs-item/src/tabs-item.vue b/packages/fighting-design/tabs-item/src/tabs-item.vue index 478b2169d8..eeeb733c23 100644 --- a/packages/fighting-design/tabs-item/src/tabs-item.vue +++ b/packages/fighting-design/tabs-item/src/tabs-item.vue @@ -7,8 +7,7 @@ getCurrentInstance, ref, onMounted, - reactive, - toRef + reactive } from 'vue' import type { ComponentInternalInstance } from 'vue' @@ -28,7 +27,7 @@ const options = reactive({ activeName, uid: instance.uid, - label: toRef(prop, 'label') + label: prop.label }) /** 该组件是否显示 */ diff --git a/packages/fighting-design/tabs/src/tabs.vue b/packages/fighting-design/tabs/src/tabs.vue index f260f8b56c..e504db7b9e 100644 --- a/packages/fighting-design/tabs/src/tabs.vue +++ b/packages/fighting-design/tabs/src/tabs.vue @@ -84,6 +84,17 @@ label: item.label } as const }) + + if (modelValue.value) { + activeName.value = modelValue.value + return + } + + if (children.value && children.value.length) { + if (children.value[0].name) { + activeName.value = children.value[0].name + } + } } /** 将信息传递给子组件 */ @@ -104,7 +115,6 @@