发布:2023/12/7 15:15:39作者:大数据 来源:大数据 浏览次数:448
1 2 3 4 5 6 7 8 9 |
<swiper indicator-dots="true" autoplay="{{autoplay}}" duration="{{duration}}" interval="{{interval}}"> <view wx:for="{{banner}}" wx:key="unique"> <swiper-item> <view> <navigator url="{{item.target}}"><image src="{{item.image}}" mode="scaleToFill center" class="banner"></image></navigator> </view> </swiper-item> </view> </swiper> |
采用rpx代替px,使得小程序根据屏幕进行绽放
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
/** * 页面的初始数据 */ data: { banner: [ { target: '1', image: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg' }, { target: '1', image: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg' }, { target: '1', image: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg' } ], autoplay: true, interval: 2000, duration: 1000, txtAds: "null", advertise: null }, |
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4