diff --git a/src/components/tabs/tab.js b/src/components/tabs/tab.js index 9a82cef87be..24fa89d81f8 100644 --- a/src/components/tabs/tab.js +++ b/src/components/tabs/tab.js @@ -1,6 +1,9 @@ import idMixin from '../../mixins/id' +import warn from '../../utils/warn' import { requestAF } from '../../utils/dom' +const DEPRECATED_MSG = 'Setting prop "href" is deprecated. Use the component instead' + // @vue/component export default { name: 'BTab', @@ -60,7 +63,10 @@ export default { // + + / should be used instead // And we dont support router-links here type: String, - default: '#' + default: '#', + // deprecated: means don't use this prop + // deprecation: refers to a change in prop usage + deprecated: DEPRECATED_MSG }, lazy: { type: Boolean, @@ -128,6 +134,11 @@ export default { mounted() { // Initially show on mount if active and not disabled this.show = this.localActive + // Deprecate use of `href` prop + if (this.href && this.href !== '#') { + /* istanbul ignore next */ + warn(`b-tab: ${DEPRECATED_MSG}`) + } }, updated() { // Force the tab button content to update (since slots are not reactive)