码迷,mamicode.com
首页 > Web开发 > 详细

template.js 模版内调用外部JS方法

时间:2019-08-15 14:35:59      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:ret   func   eid   jquery   one   from   javascrip   ==   template   

 

        <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方法

标签:ret   func   eid   jquery   one   from   javascrip   ==   template   

原文地址:https://www.cnblogs.com/dreamman/p/11357661.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!