读书人

jquery tmpl 增添索引

发布时间: 2012-09-10 11:02:32 作者: rapoo

jquery tmpl 添加索引

要为默认添加$index可修改jquery-tmpl.js

@@?-144,7?+144,8?@@
-????????jQuery.map(?data,?function(?dataItem?)?{+????????jQuery.map(?data,?function(?dataItem,?index?)?{+??????????if(dataItem){dataItem.$index?=?index;}
?????????[?newTmplItem(?options,?parentItem,?tmpl,?data?)?];

?

https://github.com/clarkbox/jquery-tmpl/commit/993e6fa128c5991723316032abe12ff0cbbb9805