diff --git a/src/utils/index.js b/src/utils/index.js index e97a8be..0f14aed 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -68,3 +68,7 @@ export function formatTime(time, option) { ) } } + +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 07793b9..5d366f2 100644 --- a/src/views/layout/components/Sidebar/Link.vue +++ b/src/views/layout/components/Sidebar/Link.vue @@ -7,7 +7,7 @@