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 8bdf60c + 3859a48 commit 71a2fddCopy full SHA for 71a2fdd
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
+ // fix:修复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