<swiper indicator-dots="{{indicatorDots}}"
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}" indicator-dots="true">
<block wx:for="{{imgUrls}}">
<swiper-item>
<image src="{{item}}" class="slide-image" width="355" height="150"/>
</swiper-item>
</block>
</swiper>
这是index.wxml
const app = getApp()
Page({
data: {
imgUrls: [
'images/swiper01.jpg',
'images/swiper02.png'
],
indicatorDots: false,
autoplay: false,
interval: 5000,
duration: 1000
},
onLoad: function () {
}
})
这是index.js
控制台输出
可以了我试了一下写成/images/xx.jpg就可以了
图片地址??是相对路径
写一下/images/xx.jpg这个路径试试