Skip to content

Commit 7a38bd8

Browse files
Merge pull request #4112 from nextcloud/backport/render-tab-in-tabs-without-context
NcAppSidebarTabs: fix rendering tabs with CSS icon in `OCA.Files.Sidebar`
2 parents fdce835 + 7d6a4b3 commit 7a38bd8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/NcAppSidebar/NcAppSidebarTabs.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@
4949
role="tab"
5050
@click.prevent="setActive(tab.id)">
5151
<span class="app-sidebar-tabs__tab-icon">
52-
<NcVNodes :vnodes="tab.renderIcon()" />
52+
<NcVNodes :vnodes="tab.renderIcon()">
53+
<span :class="tab.icon" />
54+
</NcVNodes>
5355
</span>
5456
{{ tab.name }}
5557
</a>

src/components/NcAppSidebarTab/NcAppSidebarTab.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
</template>
4242

4343
<script>
44-
import { h } from 'vue'
45-
4644
export default {
4745
name: 'NcAppSidebarTab',
4846
@@ -126,12 +124,12 @@ export default {
126124
},
127125
128126
/**
129-
* Render tab's icon from slot or icon prop
127+
* Render tab's icon slot if any
130128
*
131-
* @return {import('vue').VNode|import('vue').VNode[]}
129+
* @return {import('vue').VNode[]}
132130
*/
133131
renderIcon() {
134-
return this.$slots.icon || this.$scopedSlots.icon?.() || h('span', { staticClass: this.icon })
132+
return this.$scopedSlots.icon?.()
135133
},
136134
},
137135
}

0 commit comments

Comments
 (0)