File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
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"
12
- :target =" isMailto(link) ? null : '_blank'"
13
- :rel =" isMailto(link) ? null : 'noopener noreferrer'"
12
+ :target =" isMailto(link) || isTel(link) ? null : '_blank'"
13
+ :rel =" isMailto(link) || isTel(link) ? null : 'noopener noreferrer'"
14
14
>{{ item.text }}</a >
15
15
</template >
16
16
17
17
<script >
18
- import { isExternal , isMailto , ensureExt } from ' ./util'
18
+ import { isExternal , isMailto , isTel , ensureExt } from ' ./util'
19
19
20
20
export default {
21
21
props: {
@@ -30,7 +30,8 @@ export default {
30
30
},
31
31
methods: {
32
32
isExternal,
33
- isMailto
33
+ isMailto,
34
+ isTel
34
35
}
35
36
}
36
37
</script >
Original file line number Diff line number Diff line change 1
1
export const hashRE = / # .* $ /
2
2
export const extRE = / \. ( m d | h t m l ) $ /
3
3
export const endingSlashRE = / \/ $ /
4
- export const outboundRE = / ^ ( h t t p s ? : | m a i l t o : ) /
4
+ export const outboundRE = / ^ ( h t t p s ? : | m a i l t o : | t e l : ) /
5
5
6
6
export function normalize ( path ) {
7
7
return path
@@ -24,6 +24,10 @@ export function isMailto (path) {
24
24
return / ^ m a i l t o : / . test ( path )
25
25
}
26
26
27
+ export function isTel ( path ) {
28
+ return / ^ t e l : / . test ( path )
29
+ }
30
+
27
31
export function ensureExt ( path ) {
28
32
if ( isExternal ( path ) ) {
29
33
return path
You can’t perform that action at this time.
0 commit comments