diff --git a/components/Link.vue b/components/Link.vue index 077968bf..7c5380f1 100644 --- a/components/Link.vue +++ b/components/Link.vue @@ -2,10 +2,7 @@ @@ -22,16 +19,25 @@ export default class Link extends Vue { @Prop(String) readonly href: string | undefined @Prop({ default: false }) readonly isInline!: boolean + get attrs() { + if (this.to) { + return { to: this.to } + } + if (this.href) { + return { + href: this.href, + target: '_blank', + rel: 'noopener noreferrer', + } + } + return {} + } + get tag() { if (this.to) return 'NuxtLink' return 'a' } - get rel() { - if (this.href) return 'noopener noreferrer' - return null - } - get rootClasses() { return [ this.isInline ? 'inline-flex' : 'flex',