【发布时间】:2020-02-14 11:24:53
【问题描述】:
如何用动态值替换{$name}、{$city}、{$country}。动态值是 json 格式。
我的要求:最初只有用户使用 CKEditor 创建布局设计。然后用户将上传 CSV 文件。 CSV 中的所有数据都将替换 {$value}。就是这个概念
<p>This is the <strong>default </strong>CKEditor installation.{$name} Source editing is provided by the Source Editing Area</a> plugin.</p><p>Follow the{$city}steps below to try it{$country}out:</p><ul><li>Click the <strong>Source </strong>button to display the HTML source of this tex {$website} {$email}in the source editing area.</li><li>Click the <strong>Source </strong>button again to return to the WYSIWYG view.</li></ul><form>First name:<br>
JSON 格式:
[
{
"name": "Lijo",
"city": "Banglaore",
"country": "India",
"website": "",
"email": ""
},
{
"name": "Thoams",
"city": "Chennai",
"country": "India",
"website": "",
"email": ""
},
{
"name": "Maria",
"city": "Mumbai",
"country": "India",
"website": "",
"email": ""
},
{
"name": "Dravid",
"city": "New York",
"country": "US",
"website": "",
"email": ""
},
{
"name": "Sachin",
"city": "London",
"country": "UK",
"website": "",
"email": ""
},
{
"name": "John",
"city": "Canbera",
"country": "AUS",
"website": "",
"email": ""
}
]
【问题讨论】:
-
多用户的 JSON 会创建多行文本吗?
标签: javascript node.js reactjs