We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5ef5ee6 + 0a4a9e0 commit 38360eeCopy full SHA for 38360ee
src/utils/is.ts
@@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined'
98
export const isClient = !isServer
99
100
export const isUrl = (path: string): boolean => {
101
+ //修复路由匹配带hash路由#的地址无法跳转的问题
102
const reg =
- /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
103
+ /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%#\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
104
return reg.test(path)
105
}
106
0 commit comments