标签:fill height 方案 show color 小程序 marker pac bsp
微信小程序制作轮播图时遇到的问题,主要是对前端的不熟悉造成的.开始的问题是我想把轮播图做成圆角的,结果一直特别丑...直接放出解决之后的方案:
wxml:
<view class=‘swiper‘> <swiper indicator-dots="{{indicatorDots}}"autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> <block wx:for="{{imgUrls}}"> <swiper-item> <image src="{{item}}" class="swiper-pic" mode=‘aspectFill‘ /> </swiper-item> </block> </swiper> </view>
//index.js //获取应用实例 const app = getApp() Page({ data: { userInfo: {}, hasUserInfo: false, canIUse: wx.canIUse(‘button.open-type.getUserInfo‘), markers: [], imgUrls: [ // ‘../img/test.png‘, ‘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‘, ], tips: { }, indicatorDots: true, autoplay: true, interval: 5000, duration: 1000 }, })
成果图:
标签:fill height 方案 show color 小程序 marker pac bsp
原文地址:https://www.cnblogs.com/donke/p/9504872.html