<template name="odd"> <view> odd </view> </template> <template name="even"> <
view> even </view> </template> // Receive transmission value <template name="msgItem"> <view> <text> {{
index}}: {{msg}} </text> <text> Time: {{time}} </text> </view> </template> <
block wx:for="{{[1, 2, 3, 4, 5]}}"> <template is="{{item % 2 == 0 ? 'even' :
'odd'}}"/> </block> // Define transfer value <template is="msgItem" data="{{...item}}"/> Page({
data: { item: { index: 0, msg: 'this is a template', time: '2016-09-15' } } })
References to templates
<!-- item.wxml --> <template name="item"> <text>{{text}}</text> </template> <
import src="item.wxml"/> <template is="item" data="{{text: 'forbar'}}"/>

©2019-2020 Toolsou All rights reserved,
about String How to create objects JavaScript Hundred refining into Immortals 1.15 Legendary Is MCU embedded , It's a cliche Resume the 13th session python Blue Bridge Cup html+css+js Make a simple website home page java Connect to the database to realize basic addition, deletion, modification and query VHDL——JK trigger Java of JDBC programming 3 4j It's not legal python expression _3+4j It's not legal Python expression .【linux】shell: ordinary shell Script exercise