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> <template>
<routable-tabs <div class="config-panel">
:routes="routes_" <routable-tabs
v-bind="{ panels, forms, v: $v, ...$attrs }" v-if="routes_.length > 1"
v-on="$listeners" :routes="routes_"
> v-bind="{ panels, forms, v: $v, ...$attrs }"
<slot name="tab-top" slot="tab-top"></slot> v-on="$listeners"
<slot name="tab-before" slot="tab-before"></slot> >
<slot name="tab-after" slot="tab-after"></slot> <slot name="tab-top" slot="tab-top" />
</routable-tabs> <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> </template>
<script> <script>

View file

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