Skip to content

Commit

Permalink
fix: escape string
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 6, 2023
1 parent 30f8611 commit 0325357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2366,5 +2366,5 @@ export function resolveObjectKey(node: Node, computed: boolean) {
*/
export const escapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g
function getEscapedKey(key: string) {
return escapeSymbolsRE.test(key) ? `"${key}"` : key
return escapeSymbolsRE.test(key) ? JSON.stringify(key) : key
}

0 comments on commit 0325357

Please sign in to comment.