Skip to content

Commit

Permalink
Merge pull request #4112 from nextcloud/backport/render-tab-in-tabs-w…
Browse files Browse the repository at this point in the history
…ithout-context

NcAppSidebarTabs: fix rendering tabs with CSS icon in `OCA.Files.Sidebar`
  • Loading branch information
nickvergessen authored May 15, 2023
2 parents fdce835 + 7d6a4b3 commit 7a38bd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/NcAppSidebar/NcAppSidebarTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
role="tab"
@click.prevent="setActive(tab.id)">
<span class="app-sidebar-tabs__tab-icon">
<NcVNodes :vnodes="tab.renderIcon()" />
<NcVNodes :vnodes="tab.renderIcon()">
<span :class="tab.icon" />
</NcVNodes>
</span>
{{ tab.name }}
</a>
Expand Down
8 changes: 3 additions & 5 deletions src/components/NcAppSidebarTab/NcAppSidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
</template>

<script>
import { h } from 'vue'

export default {
name: 'NcAppSidebarTab',

Expand Down Expand Up @@ -126,12 +124,12 @@ export default {
},

/**
* Render tab's icon from slot or icon prop
* Render tab's icon slot if any
*
* @return {import('vue').VNode|import('vue').VNode[]}
* @return {import('vue').VNode[]}
*/
renderIcon() {
return this.$slots.icon || this.$scopedSlots.icon?.() || h('span', { staticClass: this.icon })
return this.$scopedSlots.icon?.()
},
},
}
Expand Down

0 comments on commit 7a38bd8

Please sign in to comment.