Skip to content

Commit

Permalink
feat: tab 改进
Browse files Browse the repository at this point in the history
  • Loading branch information
tuanzisama committed Nov 15, 2024
1 parent e448c17 commit 470718b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .vitepress/theme/components/nitwikit-ui/packages/tabs/tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<TabProvide['$store']>("$store", { tabValue, tabItems })
Expand Down Expand Up @@ -56,6 +60,7 @@ type TabItem = Record<'label' | 'value', string>;
width: 100%;
display: flex;
flex-direction: column;
margin: 15px 0;
&__header {
display: flex;
Expand Down

0 comments on commit 470718b

Please sign in to comment.