art-template的官方文档(网址:https://aui.github.io/art-template/docs/)中对循环的介绍如下:

循环

标准语法

{{each target}}
{{$index}} {{$value}}
{{/each}}

原始语法

<% for(var i = 0; i < target.length; i++){ %>
<%= i %> <%= target[i] %>
<% } %>
  1. target 支持 array 与 object 的迭代,其默认值为 $data
  2. $value 与 $index 可以自定义:{{each target val key}}

但我在应用时,使用{{each target val key}}这样的代码会导致循环部分的html片段渲染不到页面中,也不会报错,代码如下:

art-template的循环操作

当我修改为这样时,问题就解决了

art-template的循环操作

 

相关文章:

  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2021-10-11
  • 2021-07-17
猜你喜欢
  • 2021-04-07
  • 2021-04-17
  • 2021-06-17
  • 2021-09-24
  • 2021-12-15
  • 2021-11-30
相关资源
相似解决方案