您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

微信小程序开发之滑块视图容器

2025/4/4 6:03:29发布16次查看
微信小程序 开发之滑块视图容器详解
实现效果图:
实现起来特别简单,看看代码是怎么写的呢:
<swiper class="swiper" indicator-dots="pw_indcatordots" autoplay="pw_autoplay" interval="pw_interval" duration="pw_duration"> <block wx:for="pw_imgurls" wx:for-index="index"> <swiper-item> <image src="pw_item" class="side-img"></image> </swiper-item> </block> </swiper>
这就是布局了,看一下js里面代码:
page({ data: { imgurls: [ 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 'http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg'], indcatordots: true, autoplay: true, interval: 5000, duration: 500 },
,swiper有以下一些常用属性:
标记的两个属性暂时不管。
注意:其中只可放置组件,否则会导致未定义的行为。
swiper-item
仅可放置在组件中,宽高自动设置为100%。
就是这样,自己动手试试。
以上就是微信小程序开发之滑块视图容器的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product