Use of arttemplate templates

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.