File tree 1 file changed +15
-3
lines changed
packages/@vuepress/theme-default/components
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 9
9
v-else
10
10
:href =" link"
11
11
class =" nav-link external"
12
- :target =" isMailto(link) || isTel(link) ? null : '_blank' "
13
- :rel =" isMailto(link) || isTel(link) ? null : 'noopener noreferrer' "
12
+ :target =" target "
13
+ :rel =" rel "
14
14
>
15
15
{{ item.text }}
16
- <OutboundLink />
16
+ <OutboundLink v-if = " isTargetBlank " />
17
17
</a >
18
18
</template >
19
19
@@ -37,6 +37,18 @@ export default {
37
37
return Object .keys (this .$site .locales ).some (rootLink => rootLink === this .link )
38
38
}
39
39
return this .link === ' /'
40
+ },
41
+
42
+ target () {
43
+ return isMailto (this .link ) || isTel (this .link ) ? null : this .item .target || ' _blank'
44
+ },
45
+
46
+ isTargetBlank () {
47
+ return this .target === ' _blank'
48
+ },
49
+
50
+ rel () {
51
+ return isMailto (this .link ) || isTel (this .link ) ? null : this .item .rel || ' noopener noreferrer'
40
52
}
41
53
},
42
54
You can’t perform that action at this time.
0 commit comments