标签隐藏
<image wx:if="{{false}}"
组件复用
wxml
<block wx:for="{{contentkey}}" wx:for-item="item">
<view class="news">
<view class="head">
<image src="{{item.img.authimg}}"></image>
<text>{{"from "+item.date}}</text>
</view>
<image class="backimg" src="{{item.img.backimg}}"></image>
<text>{{item.text}}</text>
</view>
</block>
js
var content=[{
date:"Oct 29 2017",
img:{
backimg: "imgs/cat.png",
authimg: "imgs/1.png",
},
text:"似虎能缘木,如驹不伏辕。但知空鼠穴,无意为鱼餐。薄荷时时醉,氍毹夜夜温。前生旧童子,伴我老山村。",
hide:true
},
{date:"Sep 28 2017",
img:{
backimg: "imgs/crab.png",
authimg: "imgs/3.png",
},
text: "服役无人自炷香,狸奴乃肯伴禅房。昼眠共藉床敷软,夜坐同闻漏鼓长。贾勇遂能空鼠穴,策勋何止履胡肠。鱼飱虽薄真无愧,不向花间捕蝶忙。",
hide:true
},
]
this.setData({
contentkey:content
});
},