Skip to content

Commit 71a2fdd

Browse files
YunaiVgitee-org
authored andcommitted
!568 修复hash路由无法跳转
Merge pull request !568 from hecongyuan/master
2 parents 8bdf60c + 3859a48 commit 71a2fdd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/is.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined'
9898
export const isClient = !isServer
9999

100100
export const isUrl = (path: string): boolean => {
101+
// fix:修复hash路由无法跳转的问题
101102
const reg =
102-
/(((^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]*))?)$/
103104
return reg.test(path)
104105
}
105106

0 commit comments

Comments
 (0)