From c752fc83c367a63e0c573ddc716ac58096d86a29 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Tue, 1 Aug 2017 01:56:15 -0300 Subject: [PATCH] fix(navbar-brand): Refactored component logic (#759) --- lib/components/navbar-brand.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/components/navbar-brand.vue b/lib/components/navbar-brand.vue index 97768e0669c..bf6390ca9c9 100644 --- a/lib/components/navbar-brand.vue +++ b/lib/components/navbar-brand.vue @@ -1,11 +1,8 @@ @@ -22,7 +19,7 @@ import { assign } from '../utils/object'; const linkProps = assign(omitLinkProps('href', 'to', 'tag'), { href: { type: originalLinkProps.href.type }, to: { type: originalLinkProps.to.type }, - tag: { type: String, default: 'div' } + tag: { type: String } }); export default { @@ -31,7 +28,13 @@ export default { computed: { linkProps: computed.linkProps, isLink() { - return this.to || this.href; + return this.to || this.href; + }, + componentTag(){ + return this.isLink ? `b-link` : (this.tag || 'div'); + }, + conditionalLinkProps() { + return this.isLink ? this.linkProps : {}; } } };