diff --git a/src/utils/index.js b/src/utils/index.js index f607910c..3af8b29b 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -296,3 +296,7 @@ export function deepClone(source) { export function uniqueArr(arr) { return Array.from(new Set(arr)) } + +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} diff --git a/src/views/layout/components/Sidebar/Link.vue b/src/views/layout/components/Sidebar/Link.vue index 07793b9a..5d366f24 100644 --- a/src/views/layout/components/Sidebar/Link.vue +++ b/src/views/layout/components/Sidebar/Link.vue @@ -7,7 +7,7 @@