template.js 模版内调用外部JS方法
Posted dreamman
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了template.js 模版内调用外部JS方法相关的知识,希望对你有一定的参考价值。
<script src="js/jquery-1.11.1.js" ></script> <script src="js/template.js"></script> <script type="text/javascript"> template.helper("fromatMoney", function (x,y) return JSON.stringify(x)+‘,‘+y; ); </script> <script id="initData" type="text/html"> <!--"success":true,"data":["Id":412,"Integral":1000,"MemberId":818,"RecordDate":"2019-07-20T14:50:01","ReMark":"积分购买(¥200)","TypeId":14,"UserName":"Sinper"]--> fromatMoney(data,1) each data as item i if item.TypeId == 14 <li class="mui-table-view-cell integral-details-list"> <ul class="integral-details-left"> <li class="integral-details-record integral-purchase">item.ReMark</li> <li class="integral-details-time">item.RecordDate.replace(‘T‘,‘ ‘)</li> </ul> <span class="mui-pull-right integral-plus-wrap"> +item.Integral </span> </li> /if if item.TypeId == 15 <li class="mui-table-view-cell integral-details-list"> <ul class="integral-details-left"> <li class="integral-details-record integral-presentation">item.ReMark</li> <li class="integral-details-time">item.RecordDate.replace(‘T‘,‘ ‘)</li> </ul> <span class="mui-pull-right integral-reduce-wrap">-item.Integral</span> </li> /if /each </script>
以上是关于template.js 模版内调用外部JS方法的主要内容,如果未能解决你的问题,请参考以下文章