【微信小程序】--小程序中循環遍歷(包括js中遍歷和wxml中的遍歷)



文章為博主原創,純屬個人見解,如有錯誤歡迎指出。

如需轉載,請注明出處。


在js中遍歷

        for (var index in res.data.infos) {
          res.data.infos[index].info_file = res.data.infos[index].info_file.split(',');
        }

 

在wxml中遍歷

<view class="img" wx:for="{{item.info_file}}" wx:for-item="img" wx:key="img" id="img" bindtap='previewImg' id="img" data-imgs='{{item.info_file}}' data-currentimg="{{img}}">
       <image src="{{server_host}}{{img}}"></image>
</view>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM