1,一个是简单的例子,代码如下,作用是点击地址跳转的:

{field:'url',title:'链接地址',templet: '#urlTpl'},//绑定tpl表达式
<script type="text/html" id="urlTpl">
    <a href="{{d.url}}" target="_blank">{{d.url}}</a>
</script>

2, 判断数字的template,代码如下:

{field:'hot',title:'是否热门',templet: '#hotTpl'},
<script type="text/html" id="hotTpl">
    {{# if(d.hot == 1){  }}
        <p color="blue"></p>
    {{# }else{             }}
         <p color="blue"></p>
    {{#      }      }}
</script>

注意:只有js的代码,采用        {{#}}       包裹

遇到还有别的就,以后再加

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-11-28
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-28
  • 2021-12-07
  • 2022-12-23
  • 2021-12-31
  • 2021-05-04
  • 2021-11-23
相关资源
相似解决方案