亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

arttemplate.js的helper如何用?

arttemplate.js的helper如何用?

BIG陽 2018-11-14 18:18:00
我是根據官方的栗子來學習的但是出現了一個問題我想用helper注冊一個方法但是總是提示template.helper is not a function不知是我調用時有問題還是引入的js有問題代碼如下<!DOCTYPE html><html><head>    <meta charset="UTF-8">    <title>arttemplate</title>    <script src="template-web.js"></script></head><body>    <div id="content3"></div>    <script id="test3" type="text/html">            //<p>{{add(1,2)}}</p>            <p>{{add:'1,2'}}</p>    </script></body><script>    template.helper('add',function(val1,val2){        return val1 + val2;    });    //var data3 = {        //list: [32,45,47,61,52,41,32,29,44,24,55,19]    //}    var html = template('test3');    document.getElementById('content3').innerHTML = html;</script></html>
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 496 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號