Skip to content

Commit 463bab8

Browse files
author
drjonnicholson
committed
npm run build
1 parent 0952d7d commit 463bab8

File tree

6 files changed

+143
-38
lines changed

6 files changed

+143
-38
lines changed

dist/vue-tabs.common.js

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/*!
22
* vue-nav-tabs v0.5.6
3-
* (c) 2017-present cristij <joracristi@gmail.com>
3+
* (c) 2018-present cristij <joracristi@gmail.com>
44
* Released under the MIT License.
55
*/
66
'use strict';
77

88
Object.defineProperty(exports, '__esModule', { value: true });
99

10+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
11+
12+
var _mergeJSXProps = _interopDefault(require('babel-helper-vue-jsx-merge-props'));
13+
1014
var VueTabs = {
1115
name: 'vue-tabs',
1216
props: {
@@ -142,6 +146,13 @@ var VueTabs = {
142146
);
143147

144148
if (tab.$slots.title) return tab.$slots.title;
149+
if (tab.$scopedSlots.title) return tab.$scopedSlots.title({
150+
active: active,
151+
title: title,
152+
position: position,
153+
icon: tab.icon,
154+
data: tab.tabData
155+
});
145156
return simpleTitle;
146157
},
147158
renderIcon: function renderIcon(index) {
@@ -183,35 +194,49 @@ var VueTabs = {
183194
var active = _this.activeTabIndex === index;
184195
return h(
185196
'li',
186-
{
197+
_mergeJSXProps([{
187198
attrs: { name: 'tab',
188199
id: 't-' + tabId,
189200
'aria-selected': active,
190201
'aria-controls': 'p-' + tabId,
191202
role: 'tab' },
192-
on: {
193-
'click': function click() {
194-
return !tab.disabled && _this.navigateToTab(index, route);
195-
}
196-
},
197203

198204
'class': ['tab', { active: active }, { disabled: tab.disabled }],
199-
key: title },
205+
key: title }, {
206+
on: {
207+
'click': function click($event) {
208+
for (var _len = arguments.length, attrs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
209+
attrs[_key - 1] = arguments[_key];
210+
}
211+
212+
(function () {
213+
return !tab.disabled && _this.navigateToTab(index, route);
214+
}).apply(undefined, [$event].concat(attrs));
215+
}
216+
}
217+
}]),
200218
[_this.textPosition === 'top' && _this.renderTabTitle(index, _this.textPosition), h(
201219
'a',
202-
{
220+
_mergeJSXProps([{
203221
attrs: { href: '#',
204222

205223
role: 'tab' },
206-
on: {
207-
'click': function click(e) {
208-
e.preventDefault();
209-
return false;
210-
}
211-
},
212224

213225
style: active ? _this.activeTabStyle : _this.tabStyles(tab),
214-
'class': [{ 'active_tab': active }, 'tabs__link'] },
226+
'class': [{ 'active_tab': active }, 'tabs__link'] }, {
227+
on: {
228+
'click': function click($event) {
229+
for (var _len2 = arguments.length, attrs = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
230+
attrs[_key2 - 1] = arguments[_key2];
231+
}
232+
233+
(function (e) {
234+
e.preventDefault();
235+
return false;
236+
}).apply(undefined, [$event].concat(attrs));
237+
}
238+
}
239+
}]),
215240
[_this.textPosition !== 'center' && !tab.$slots.title && _this.renderIcon(index), _this.textPosition === 'center' && _this.renderTabTitle(index, _this.textPosition)]
216241
), _this.textPosition === 'bottom' && _this.renderTabTitle(index, _this.textPosition)]
217242
);
@@ -276,6 +301,10 @@ var VTab = {
276301
type: String,
277302
default: ''
278303
},
304+
tabData: {
305+
type: Object,
306+
default: null
307+
},
279308
/***
280309
* Function to execute before tab switch. Return value must be boolean
281310
* If the return result is false, tab switch is restricted

dist/vue-tabs.common.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)