feat: 侧边菜单栏增加外链支持

This commit is contained in:
zhangchuanlong
2022-02-15 14:29:06 +08:00
parent 741524ffac
commit a240985ee7
3 changed files with 43 additions and 3 deletions

View File

@@ -97,6 +97,14 @@ export function isUrl(path) {
return reg.test(path)
}
/**
* @param {string} path
* @returns {Boolean}
*/
export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
export const isServer = typeof window === 'undefined'
export const isClient = !isServer