Skip to content

Commit 6508b3f

Browse files
author
cristian.jora
committed
#15 Add space to icon instead of tab title
1 parent e7b0ac8 commit 6508b3f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

dev/App.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
v-model="tabName">
55
<v-tab v-for="(tab, index) in tabList"
66
:key="tab.name"
7-
:title="tab.name"
8-
icon="ti-user">
7+
:title="tab.name">
98
{{tab.name}}
109
</v-tab>
1110
</vue-tabs>

src/components/VueTabs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default{
113113
let titleStyles = {color: this.activeTabColor}
114114
if (position === 'center') titleStyles.color = this.activeTextColor
115115
let simpleTitle = (<span class={`title title_${position}`} style={active ? titleStyles : {}}>
116-
{position === 'center' && this.renderIcon(index)}&nbsp;{title}
116+
{position === 'center' && this.renderIcon(index)}{title}
117117
</span> )
118118

119119
if (tab.$slots.title) return tab.$slots.title
@@ -123,7 +123,7 @@ export default{
123123
if (this.tabs.length === 0) return
124124
let tab = this.tabs[index]
125125
let {icon} = tab
126-
let simpleIcon = <i class={icon}></i>
126+
let simpleIcon = <i class={icon}>&nbsp;</i>
127127
if (!tab.$slots.title && icon) return simpleIcon
128128
},
129129
renderTabs () {

0 commit comments

Comments
 (0)