From 470718b6df6caaea8b6b7ca7c8934cc774a8367f Mon Sep 17 00:00:00 2001 From: tuanzi <33369729+tuanzisama@users.noreply.github.com> Date: Fri, 15 Nov 2024 08:24:20 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20tab=20=E6=94=B9=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/components/nitwikit-ui/packages/tabs/tab.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.vitepress/theme/components/nitwikit-ui/packages/tabs/tab.vue b/.vitepress/theme/components/nitwikit-ui/packages/tabs/tab.vue index a4e6c480..a3c8343f 100644 --- a/.vitepress/theme/components/nitwikit-ui/packages/tabs/tab.vue +++ b/.vitepress/theme/components/nitwikit-ui/packages/tabs/tab.vue @@ -29,6 +29,10 @@ onMounted(() => { if (props.defaultValue) { tabValue.value = props.defaultValue } + + if (tabValue.value === '' && tabItems.value.length !== 0) { + tabValue.value = tabItems.value[0].value + } }) provide("$store", { tabValue, tabItems }) @@ -56,6 +60,7 @@ type TabItem = Record<'label' | 'value', string>; width: 100%; display: flex; flex-direction: column; + margin: 15px 0; &__header { display: flex;