We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
示例:
const template = '嗨,{{ info.name.value }}您好,今天是星期 {{ day.value }}'; const data = { info: { name: { value: '张三' } }, day: { value: '三' } }; render(template, data); // 嗨,张三您好,今天是星期三
The text was updated successfully, but these errors were encountered:
function render(template, data) { return template.replace(/\{\{([\s\S]+?)\}\}/g, function(match, $1) { var val = $1.trim(); return eval('data.' + val) }) }
Sorry, something went wrong.
No branches or pull requests
示例:
The text was updated successfully, but these errors were encountered: