diff --git a/src/runtime/utils/index.ts b/src/runtime/utils/index.ts index f8d3a525..df351a51 100644 --- a/src/runtime/utils/index.ts +++ b/src/runtime/utils/index.ts @@ -61,5 +61,5 @@ export function looseToNumber(val: any): any { } export function escapeRegExp(string: string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + return string.replace(/[.*+?^${}()|[\]\\]/g, match => `\\${match}`) }