diff --git a/packages/@vuepress/theme-default/components/NavLink.vue b/packages/@vuepress/theme-default/components/NavLink.vue index 452a1c6dc8..0bc382b4c2 100644 --- a/packages/@vuepress/theme-default/components/NavLink.vue +++ b/packages/@vuepress/theme-default/components/NavLink.vue @@ -9,11 +9,11 @@ v-else :href="link" class="nav-link external" - :target="isMailto(link) || isTel(link) ? null : '_blank'" - :rel="isMailto(link) || isTel(link) ? null : 'noopener noreferrer'" + :target="target" + :rel="rel" > {{ item.text }} - + @@ -37,6 +37,18 @@ export default { return Object.keys(this.$site.locales).some(rootLink => rootLink === this.link) } return this.link === '/' + }, + + target () { + return isMailto(this.link) || isTel(this.link) ? null : this.item.target || '_blank' + }, + + isTargetBlank () { + return this.target === '_blank' + }, + + rel () { + return isMailto(this.link) || isTel(this.link) ? null : this.item.rel || 'noopener noreferrer' } },