Skip to content

Commit

Permalink
fix(NcAppSidebarTabs): fix render when tab and tabs are in different vue
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed May 13, 2023
1 parent fdce835 commit 7d6a4b3
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
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
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 7d6a4b3

Please sign in to comment.