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
接上一个 issue :#408
{{class}}会报错。class在json中还是蛮常用。
var html = template.compile(` <h1>{{title}}</h1><div>{{class}}</div> <ul> {{each list as value i}} <li onclick="showMe('{{value}}')">索引 {{i + 1}} :{{value}}</li> {{/each}} </ul> `)({ title: '标签', list: ['文艺', '博客', '摄影', '电影', '民谣', '旅行', '吉他'], class: 'abc' });
版本: [email protected]
The text was updated successfully, but these errors were encountered:
有一个限制:目标输出的变量不能是 javascript 关键字或保留字。
下面都是非法的:
{{var}} {{a ? class : var}}
解决方案:
模板一级特殊变量可以使用 $data 加下标的方式访问
{{$data['var']}} {{a ? $data['class'] : $data['var']}}
Sorry, something went wrong.
好。多谢~~~
原来做了处理的,不错不错
No branches or pull requests
接上一个 issue :#408
{{class}}会报错。class在json中还是蛮常用。
版本: [email protected]
The text was updated successfully, but these errors were encountered: