RoutableTabs: defaults to simple card if one tab

This commit is contained in:
axolotle 2023-01-18 11:53:33 +01:00
parent 3b6b453f43
commit b2fef109a5
2 changed files with 22 additions and 9 deletions

View file

@ -1,13 +1,22 @@
<template>
<routable-tabs
:routes="routes_"
v-bind="{ panels, forms, v: $v, ...$attrs }"
v-on="$listeners"
>
<slot name="tab-top" slot="tab-top"></slot>
<slot name="tab-before" slot="tab-before"></slot>
<slot name="tab-after" slot="tab-after"></slot>
</routable-tabs>
<div class="config-panel">
<routable-tabs
v-if="routes_.length > 1"
:routes="routes_"
v-bind="{ panels, forms, v: $v, ...$attrs }"
v-on="$listeners"
>
<slot name="tab-top" slot="tab-top" />
<slot name="tab-before" slot="tab-before" />
<slot name="tab-after" slot="tab-after" />
</routable-tabs>
<card v-else :title="routes_[0].text" :icon="routes_[0].icon">
<slot name="tab-top" />
<slot name="tab-before" />
<slot name="tab-after" />
</card>
</div>
</template>
<script>

View file

@ -526,4 +526,8 @@ select {
.yuno-alert div div:not(:last-child) {
margin-bottom: 1rem;
}
.config-panel {
margin-bottom: 2rem;
}
</style>