From def039ebcf8c7f61face24e0fb55f6f0c7163224 Mon Sep 17 00:00:00 2001 From: zhangsiyu Date: Mon, 21 Aug 2023 13:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=85=A8=E5=B1=80=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/util.js b/src/utils/util.js index 3ca129bc..6aa7f33e 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -319,8 +319,9 @@ export const getHtmls = (arrs, htmldemo) => { arrs.map(item => { let strhtml = JSON.parse(JSON.stringify(htmldemo)); for (let key in item) { - let str = '${' + key + '}'; - strhtml = strhtml.replace(new RegExp(str, 'g'), item[key]); + let str = '\\$\\{' + key + '\\}'; + let reg=new RegExp(str,"g") + strhtml = strhtml.replace(reg, item[key]); } html += strhtml; });