Skip to content

Commit 5db3937

Browse files
committed
fix: issue with two or more placeholders rendering
1 parent c770138 commit 5db3937

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const CoCreateRender = {
5757
},
5858

5959
__replaceValue: function(data, inputValue, renderKey, el) {
60-
let outputValue = null;
60+
let outputValue = inputValue;
6161
let placeholders = inputValue.match(/{{([A-Za-z0-9_.,\[\]\- ]*)}}/g);
6262
if (placeholders) {
6363
for (let placeholder of placeholders) {
@@ -67,7 +67,7 @@ const CoCreateRender = {
6767
if (typeof(value) == "object")
6868
value = this.generateString(value)
6969

70-
outputValue = inputValue.replace(placeholder, value);
70+
outputValue = outputValue.replace(placeholder, value);
7171
} else if (renderKey && placeholder.includes(`{{${renderKey}.`)) {
7272
outputValue = '';
7373
}
@@ -271,6 +271,8 @@ const CoCreateRender = {
271271
else
272272
that.renderMap(attr, attr.value, renderArray, renderKey)
273273

274+
if (attr_name == 'modal-src' && data.document.name == 'Contacts')
275+
console.log(attr_name)
274276
if (placeholder && !isRenderKey){
275277
let temp = placeholder.placeholder;
276278
// let updateData

0 commit comments

Comments
 (0)