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
您好,请问,我能在在模板里面定义局部变量吗?情况如下:
js data: var json = { person:[{ 0 : { name:'test' ...... } ,1 : { name:'text' .......} }] };
template: {@each person as p,index} ${p[index].name} 请问我能为p[index]定义一个局部变量吗? {@/each}
The text was updated successfully, but these errors were encountered:
模板内可以内嵌micro-template语法,所以暂时可以通过<% var temp = p[index]; %>定义局部变量,而后就可以通过${temp}输出。
micro-template
<% var temp = p[index]; %>
${temp}
Sorry, something went wrong.
No branches or pull requests
您好,请问,我能在在模板里面定义局部变量吗?情况如下:
js data:
var json = { person:[{ 0 : { name:'test' ...... } ,1 : { name:'text' .......} }] };
template:
{@each person as p,index}
${p[index].name}
请问我能为p[index]定义一个局部变量吗?
{@/each}
The text was updated successfully, but these errors were encountered: