微信小程序之模板的使用



定义模板html

< template name= "dayItem" >
< view class= 'wxtim' >
{{data}}
</ view >
</ template >

name对应模板名称 在引用时需要用到


引用模板

<!--pages/Week/index.wxml-->
< import src= "../../../template/daylist-template.wxml" / >
< template is= "dayItem" data= "{{item,MySrc}}" / >

is 定义的模板名称 data数据源 模板中的需要




这样就可以了  然后在模板中处理自己的需求逻辑

猜你喜欢

转载自blog.csdn.net/qinlulucsdn/article/details/80846609