修改模版数据填充

dev
suixy 2 months ago
parent 386d30737c
commit 82dee959af

@ -62,7 +62,7 @@ const options = ref({
//
const renderTemplate = (str, data) => {
return str.replace(/#\{(.*?)\}/g, (_, path) => {
return path.split('.').reduce((o, k) => o?.[k], data) ?? '';
return path.split('.').reduce((o, k) => o?.[k], data) ?? ' ';
});
};
//
@ -119,7 +119,7 @@ const tableTemplate = (table) => {
Array(length)
.fill(0)
.forEach((_, index) => {
arr.push(fillRowData(obj, index));
arr.push(fillRowData(JSON.parse(JSON.stringify(obj)), index));
});
// arr.push(fillRowData(JSON.parse(JSON.stringify({ ...item, content: row })), requestData[key]));
} else {

Loading…
Cancel
Save