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 11
11
:href =" link"
12
12
@focusout =" focusoutAction"
13
13
class =" nav-link external"
14
- :target =" isMailto(link) || isTel(link) ? null : '_blank' "
15
- :rel =" isMailto(link) || isTel(link) ? null : 'noopener noreferrer' "
14
+ :target =" target "
15
+ :rel =" rel "
16
16
>
17
17
{{ item.text }}
18
- <OutboundLink />
18
+ <OutboundLink v-if = " isTargetBlank " />
19
19
</a >
20
20
</template >
21
21
@@ -39,6 +39,18 @@ export default {
39
39
return Object .keys (this .$site .locales ).some (rootLink => rootLink === this .link )
40
40
}
41
41
return this .link === ' /'
42
+ },
43
+
44
+ target () {
45
+ return isMailto (this .link ) || isTel (this .link ) ? null : this .item .target || ' _blank'
46
+ },
47
+
48
+ isTargetBlank () {
49
+ return this .target === ' _blank'
50
+ },
51
+
52
+ rel () {
53
+ return isMailto (this .link ) || isTel (this .link ) ? null : this .item .rel || ' noopener noreferrer'
42
54
}
43
55
},
44
56
You can’t perform that action at this time.
0 commit comments