File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <vue-tabs class =" card" @on-error =" handleError"
3
+ <vue-tabs class =" card"
4
+ @tab-change =" handleTabChange"
5
+ @on-error =" handleError"
4
6
v-model =" tabName" >
5
7
<v-tab v-for =" (tab, index) in tabList"
6
8
:key =" tab.name"
28
30
handleError (error ){
29
31
this .error = error
30
32
},
33
+ handleTabChange (tabIndex , newTab , oldTab ){
34
+ console .log (tabIndex, newTab .title , oldTab .title )
35
+ },
31
36
goToSecondTab (){
32
37
this .tabName = ' name2'
33
38
}
Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ export default{
100
100
} ,
101
101
findTabAndActivate ( tabNameOrIndex ) {
102
102
let indexToActivate = this . tabs . findIndex ( ( tab , index ) => tab . title === tabNameOrIndex || index === tabNameOrIndex )
103
- if ( indexToActivate != - 1 ) {
103
+ if ( indexToActivate === this . activeTabIndex ) return
104
+ if ( indexToActivate !== - 1 ) {
104
105
this . changeTab ( this . activeTabIndex , indexToActivate )
105
106
} else {
106
107
this . changeTab ( this . activeTabIndex , 0 )
@@ -139,7 +140,6 @@ export default{
139
140
this . renderTabTitle ( index , this . textPosition )
140
141
}
141
142
< a href = "javascript:void(0)"
142
- onClick = { ( ) => this . navigateToTab ( index ) }
143
143
style = { active ? this . activeTabStyle : { } }
144
144
class = { { 'active_tab' : active } }
145
145
aria-selected = { active }
You can’t perform that action at this time.
0 commit comments