0

clipboard.png
这是PHP返回的数据 两个数组对象
我前端代码:
<!--首页-->

<view hidden="{{currentTab!==0}}">  
 <view wx:for='{{logs}}'>
    {{item.pdate}}
    {{item.pweek}}
    {{item.pweather}}
    {{item.pcontent}}
    <!-- <view wx:for='{{logs.src}}'> -->
      <image src="https://yffice.com{{item.src[index]}}" class="slide-image" />
    <!-- </view> -->
    <view>
     <!-- <image wx:for='{{logs.ppic}}' wx:for-index="index" wx:for-item='picPath' src='{{picPath.src}}'></image>  -->
    <!-- <image src='{{logs.ppic[item]}}'></image> -->
    </view>
</view> 

{{item.pdate}}
{{item.pweek}}
{{item.pweather}}
{{item.pcontent}}都可以正常显示

然而<image src="https://yffice.com{{item.src[index]}}" class="slide-image" />每一天只能显示一张图 为什么?

yfxs 34
2018-04-03 提问

1 个回答

1

已采纳
<view hidden="{{currentTab!==0}}">  
 <view wx:for='{{logs}}'>
    {{item.pdate}}
    {{item.pweek}}
    {{item.pweather}}
    {{item.pcontent}}
    <view wx:for='{{item.src}}' wx:for-item="src">
      <image src="https://yffice.com{{src}}" class="slide-image" />
    </view>
    <view>
     <!-- <image wx:for='{{logs.ppic}}' wx:for-index="index" wx:for-item='picPath' src='{{picPath.src}}'></image>  -->
    <!-- <image src='{{logs.ppic[item]}}'></image> -->
    </view>
</view> 

推广链接