<template name="items">
<view class="title">{{title}}</view>
<view class="wangzhi">{{wangzhi}}</view>
<view><image src="{wimg}" class="wimg" mode="scaleToFill"></image></view>
</template>
<block wx:for="{{mydata}}" >
<template is="items" data="{{...item}}"></template>
</block>
mydata:[
{ id: 1, title: "武汉1", wangzhi: "www.1.com", wimg:"http://a8adue.m7.magic2008.cn/ufile/6624/xcx/banner/banner1.jpg"},
{ id: 2, title: "武汉2", wangzhi: "www.2.com", wimg:"http://a8adue.m7.magic2008.cn/ufile/6624/xcx/banner/banner1.jpg"},
{ id: 3, title: "武汉3", wangzhi: "www.3.com", wimg:"http://a8adue.m7.magic2008.cn/ufile/6624/xcx/banner/banner1.jpg"},
{ id: 4, title: "武汉4", wangzhi: "www.4.com", wimg:"http://a8adue.m7.magic2008.cn/ufile/6624/xcx/banner/banner1.jpg"}
]
哦哦,谢谢啦
<image src="{{wimg}}">
.wimg{
width: 100%;
height: 350rpx;
margin: 0 auto;
margin-top: 20rpx;
}
加了的
应该要设置下宽高吧