Skip to content
New issue

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

一个优化建议,循环遍历的时候加个类似于last之类的快速定位值 #12

Closed
ghost opened this issue Sep 18, 2012 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 18, 2012

在循环遍历的时候加个last,frist之类的快速定位判断,这样就更加方便了,嘿嘿!
例如:
{@each list as item, index, last}
{@if index===last}
the index is last, the value is ${item.prop}
{@/if}
{@/each}

@PaulGuo
Copy link
Owner

PaulGuo commented Oct 14, 2012

不错的建议,不过由于目前each as遍历时候,index并非必选参数,所以再加一个last/first之类的可选定位变量在匹配上有些困难,或者有好的思路欢迎提交代码。:)

thx.

@PaulGuo PaulGuo closed this as completed Oct 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant