以下是.js
data: {
d: [],
imgUrls: [
{
link:'pages/inSchool/inSchool',
url:'../images/boss.png'
},
{
link:'pages/outSchool/outSchool',
url:'../images/fabu.png'
},
{
link:'pages/personal/personal',
url:'../images/boss.png'
}
],
以下是.wxml
<swiper indicator-dots="true" autoplay="true" interval="5000" duration="1000">
<block wx:for="{{imgUrls}}" wx:key="index">
<swiper-item>
<navigator url="{{item.link}}">
<image wx:if='{{item}}' mode="widthFix" src="{{item.url}}" class="pic"/>
</navigator>
</swiper-item>
</block>
</swiper>
<view>
你确定路径对吗?最笨的办法就是加斜杠和.. 来回试,多动手,少提问。你用api跳转,然后打印下fail回调