File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import idMixin from '../../mixins/id'
2
+ import warn from '../../utils/warn'
2
3
import { requestAF } from '../../utils/dom'
3
4
5
+ const DEPRECATED_MSG = 'Setting prop "href" is deprecated. Use the <b-nav> component instead'
6
+
4
7
// @vue /component
5
8
export default {
6
9
name : 'BTab' ,
@@ -60,7 +63,10 @@ export default {
60
63
// <b-nav> + <b-card> + <router-view>/<nuxt-child> should be used instead
61
64
// And we dont support router-links here
62
65
type : String ,
63
- default : '#'
66
+ default : '#' ,
67
+ // deprecated: means don't use this prop
68
+ // deprecation: refers to a change in prop usage
69
+ deprecated : DEPRECATED_MSG
64
70
} ,
65
71
lazy : {
66
72
type : Boolean ,
@@ -128,6 +134,11 @@ export default {
128
134
mounted ( ) {
129
135
// Initially show on mount if active and not disabled
130
136
this . show = this . localActive
137
+ // Deprecate use of `href` prop
138
+ if ( this . href && this . href !== '#' ) {
139
+ /* istanbul ignore next */
140
+ warn ( `b-tab: ${ DEPRECATED_MSG } ` )
141
+ }
131
142
} ,
132
143
updated ( ) {
133
144
// Force the tab button content to update (since slots are not reactive)
You can’t perform that action at this time.
0 commit comments