Skip to content

Commit

Permalink
Fix issue when there is no open pages
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Feb 22, 2024
1 parent 4e8aa7c commit 85fcb70
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/components/TabsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
<i class="fas fa-times" />
</span>
</template>
<div class="h-100 w-100" data-test="tab-content">
<slot :current-page="index" />
</div>
<template #default>
<div class="h-100 w-100" data-test="tab-content">
<slot :current-page="index" />
</div>
</template>
</b-tab>
<template #tabs-end>
<div
Expand All @@ -69,6 +71,13 @@
</div>
</div>
</template>
<template #empty>
<p class="text-center m-5 text-secondary" data-test="tab-content">
{{ $t("There are no open pages.") }}<br />
{{ $t("Open a new page above using the button") }}
<i :class="buttonIcon" />
</p>
</template>
</b-tabs>
</template>

Expand All @@ -90,6 +99,13 @@ export default {
initialOpenedPages: {
type: Array,
default: () => [0]
},
/**
* Icon to open a new tab, displayed when there are no pages opened.
*/
buttonIcon: {
type: String,
default: () => "fa fa-file"
}
},
data() {
Expand Down

0 comments on commit 85fcb70

Please sign in to comment.