fix(compiler-sfc): externalRE support automatic http/https prefix url pattern (#4922)

fix #4920
This commit is contained in:
zisasign
2021-11-15 10:37:50 +08:00
committed by GitHub
parent fd7c3407c7
commit 574070f43f
4 changed files with 13 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ export function isRelativeUrl(url: string): boolean {
return firstChar === '.' || firstChar === '~' || firstChar === '@'
}
const externalRE = /^https?:\/\//
const externalRE = /^(https?:)?\/\//
export function isExternalUrl(url: string): boolean {
return externalRE.test(url)
}