我想知道这是否可能。在这个例子中,HTML文件将是:
"sample_message": "
现在屏幕上显示的是
目前,我没有将
在我的渲染函数中,我有以下内容:{{i18n.sample_message}}
var json = {
i18n:i18n,
sampleDate:'10/10/10'
}
$('div').html(Mustache.to_html(template,json);
i18n文件是一个对象,其中有一个关键字:"sample_message": "
一些长信息
日期为:{{json.sampleDate}}
"现在屏幕上显示的是
{{json.sampleDate}}
。我尝试将字符串结束于分号并使用“+”来连接值,但那也不起作用。目前,我没有将
{{json.sampleDate}}
放入i18n映射中,而是将我的HTML更改为:{{i18n.sample_message}}{{json.sampleDate}}
实际上,我有一些长段落需要注入一些动态值。