1
1
/*!
2
- * vue-nav-tabs v0.5.5
2
+ * vue-nav-tabs v0.5.6
3
3
* (c) 2017-present cristij <joracristi@gmail.com>
4
4
* Released under the MIT License.
5
5
*/
@@ -176,14 +176,19 @@ var VueTabs = {
176
176
if ( ! tab ) return ;
177
177
var route = tab . route ,
178
178
id = tab . id ,
179
- title = tab . title ;
179
+ title = tab . title ,
180
+ icon = tab . icon ,
181
+ tabId = tab . tabId ;
180
182
181
183
var active = _this . activeTabIndex === index ;
182
184
return h (
183
185
'li' ,
184
186
{
185
187
attrs : { name : 'tab' ,
186
- role : 'presentation' } ,
188
+ id : 't-' + tabId ,
189
+ 'aria-selected' : active ,
190
+ 'aria-controls' : 'p-' + tabId ,
191
+ role : 'tab' } ,
187
192
on : {
188
193
'click' : function click ( ) {
189
194
return ! tab . disabled && _this . navigateToTab ( index , route ) ;
@@ -197,9 +202,14 @@ var VueTabs = {
197
202
{
198
203
attrs : { href : '#' ,
199
204
200
- 'aria-selected' : active ,
201
- 'aria-controls' : '#' + id ,
202
205
role : 'tab' } ,
206
+ on : {
207
+ 'click' : function click ( e ) {
208
+ e . preventDefault ( ) ;
209
+ return false ;
210
+ }
211
+ } ,
212
+
203
213
style : active ? _this . activeTabStyle : _this . tabStyles ( tab ) ,
204
214
'class' : [ { 'active_tab' : active } , 'tabs__link' ] } ,
205
215
[ _this . textPosition !== 'center' && ! tab . $slots . title && _this . renderIcon ( index ) , _this . textPosition === 'center' && _this . renderTabTitle ( index , _this . textPosition ) ]
@@ -287,6 +297,9 @@ var VTab = {
287
297
} ,
288
298
hash : function hash ( ) {
289
299
return '#' + this . id ;
300
+ } ,
301
+ tabId : function tabId ( ) {
302
+ return this . id ? this . id : this . title ;
290
303
}
291
304
} ,
292
305
data : function data ( ) {
@@ -310,7 +323,9 @@ var VTab = {
310
323
return h (
311
324
'section' ,
312
325
{ 'class' : 'tab-container' ,
313
- attrs : { role : 'tabpanel' } ,
326
+ attrs : { id : 'p-' + this . tabId ,
327
+ 'aria-labelledby' : 't-' + this . tabId ,
328
+ role : 'tabpanel' } ,
314
329
directives : [ {
315
330
name : 'show' ,
316
331
value : this . active
0 commit comments