Skip to content

Commit f09d989

Browse files
committed
Fix icon positioning
Add VueTabs to window (backwards compatibility)
1 parent 9a67d64 commit f09d989

File tree

8 files changed

+14
-12
lines changed

8 files changed

+14
-12
lines changed

dev/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Vue from 'vue'
22
import VueRouter from 'vue-router'
33
import App from './App.vue'
44
import VueTabs from './../src/index'
5-
import './../themes/paper.scss'
5+
import './../themes/vue-tabs.scss'
66
import './themify-icons.css'
77
const First = {template: '<div>First</div>'}
88
const Second = {template: '<div>Second</div>'}

dist/vue-tabs.common.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ var VueTabs = {
134134
var simpleTitle = h(
135135
'span',
136136
{ 'class': 'title title_' + position, style: active ? titleStyles : {} },
137-
[title]
137+
[position === 'center' && this.renderIcon(index), ' ', title]
138138
);
139139

140140
if (tab.$slots.title) return tab.$slots.title;
@@ -195,7 +195,7 @@ var VueTabs = {
195195

196196
style: active ? _this.activeTabStyle : {},
197197
'class': { 'active_tab': active } },
198-
[_this.renderIcon(index), _this.textPosition === 'center' && _this.renderTabTitle(index, _this.textPosition)]
198+
[_this.textPosition === 'center' && _this.renderTabTitle(index, _this.textPosition)]
199199
), _this.textPosition === 'bottom' && _this.renderTabTitle(index, _this.textPosition)]
200200
);
201201
});
@@ -318,6 +318,7 @@ var VueTabsPlugin = {
318318
// Automatic installation if Vue has been added to the global scope.
319319
if (typeof window !== 'undefined' && window.Vue) {
320320
window.Vue.use(VueTabsPlugin);
321+
window.VueTabs = VueTabsPlugin;
321322
}
322323

323324
exports['default'] = VueTabsPlugin;

dist/vue-tabs.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ var VueTabs = {
136136
var simpleTitle = h(
137137
'span',
138138
{ 'class': 'title title_' + position, style: active ? titleStyles : {} },
139-
[title]
139+
[position === 'center' && this.renderIcon(index), ' ', title]
140140
);
141141

142142
if (tab.$slots.title) return tab.$slots.title;
@@ -197,7 +197,7 @@ var VueTabs = {
197197

198198
style: active ? _this.activeTabStyle : {},
199199
'class': { 'active_tab': active } },
200-
[_this.renderIcon(index), _this.textPosition === 'center' && _this.renderTabTitle(index, _this.textPosition)]
200+
[_this.textPosition === 'center' && _this.renderTabTitle(index, _this.textPosition)]
201201
), _this.textPosition === 'bottom' && _this.renderTabTitle(index, _this.textPosition)]
202202
);
203203
});
@@ -320,6 +320,7 @@ var VueTabsPlugin = {
320320
// Automatic installation if Vue has been added to the global scope.
321321
if (typeof window !== 'undefined' && window.Vue) {
322322
window.Vue.use(VueTabsPlugin);
323+
window.VueTabs = VueTabsPlugin;
323324
}
324325

325326
exports['default'] = VueTabsPlugin;

dist/vue-tabs.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)