Official Open Source Address: https://github.com/aui/artTemplate
Add one:
Default HTML escape output please use: {{= $value}}, which is preceded by the = number, otherwise than the slice address, will display instead of displaying the picture, you can also turn off the default escape functiontemplate.defaults.escape = false
Add two:
Can be used in a simple way to loop, more complex judgment nesting can be stronger than TODO
Like what:
<script id= "Message-template" type= "text/html" > <ul>{Each result}} {{if$value. conversationtype== ' SYSTEM '}} <li> <a tapmode= "active" onclick= "Openwin (' Requestinfo ')" > < Div style= "Background-image:url (.. /image/icon-system.png) "> <span id=" unread ">{{$value .unreadmessagecount}}</span> <span>Else}} {{if$value. senderuserid!=$value. Curruserid}} <li> <a tapmode= "active" onclick= "openchat (This)" userid= "{{$value. Targetid}}" Realname= "{ {$value. LatestMessage.extra.split (', ') [0]}} " Targetportrait= "{{$value. latestMessage.extra.split (', ') [1]}}" > <div style= "background-image: The URL ({{$value. latestMessage.extra.split (', ') [1]}}) "> <span id=" Unread ">{{$value. unreadmess Agecount}}</span> <span>Else}} <li> <a tapmode= "active" onclick= "openchat (This)" targetuserid= "{{$value. Targetid}}" Targe Trealname= "{{$value. latestMessage.extra.split (', ') [3]}} ' targetportrait= ' {{$value. latestMessage.extra.split (', ' ) [4]}} "> <div style=" Background-image:url ({{$value. latestMessage.extra.split (', ') [4]}}) "> <span id= "Unread" >{{$value .unreadmessagecount}}</span> <sp an>Use of arttemplate templates