From d6970bc1d9d1b3c7deb4ba866374309efdcf5bcc Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Fri, 29 Mar 2019 01:37:50 -0300 Subject: [PATCH 1/3] chore(tab): deprecate use of `href` prop --- src/components/tabs/tab.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/tab.js b/src/components/tabs/tab.js index 9a82cef87be..5083fa55573 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. Us 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 thiws 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) From 364db47768fe81c3f4537036d2d4cd7f51b0387e Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Fri, 29 Mar 2019 01:42:01 -0300 Subject: [PATCH 2/3] Update tab.js --- src/components/tabs/tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tabs/tab.js b/src/components/tabs/tab.js index 5083fa55573..593ddc1a31e 100644 --- a/src/components/tabs/tab.js +++ b/src/components/tabs/tab.js @@ -135,7 +135,7 @@ export default { // Initially show on mount if active and not disabled this.show = this.localActive // Deprecate use of `href` prop - if (this.href && this.href === '#') { + if (this.href && this.href !== '#') { /* istanbul ignore next */ warn(`b-tab: ${DEPRECATED_MSG}`) } From 408cab2ba183b63fedf247ae788778b51fb2e4da Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Fri, 29 Mar 2019 01:49:48 -0300 Subject: [PATCH 3/3] fix typo --- src/components/tabs/tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tabs/tab.js b/src/components/tabs/tab.js index 593ddc1a31e..24fa89d81f8 100644 --- a/src/components/tabs/tab.js +++ b/src/components/tabs/tab.js @@ -2,7 +2,7 @@ import idMixin from '../../mixins/id' import warn from '../../utils/warn' import { requestAF } from '../../utils/dom' -const DEPRECATED_MSG = 'Setting prop "href" is deprecated. Us the component instead' +const DEPRECATED_MSG = 'Setting prop "href" is deprecated. Use the component instead' // @vue/component export default { @@ -64,7 +64,7 @@ export default { // And we dont support router-links here type: String, default: '#', - // deprecated: means don't use thiws prop + // deprecated: means don't use this prop // deprecation: refers to a change in prop usage deprecated: DEPRECATED_MSG },