The problem of the layout of WeChat Mini Programs's for cycle

use the for loop block block, roughly as follows:

<block wx:for="{{list}}" wx:key="{{index}}">
    <view id="goods-{{item.gid}}"></view>
    <view class="container-body-box-item"></view>
</block>

I want to loop to get the following arrangement pattern: spaced

    <view id="goods-1"></view>
    <view class="container-body-box-item"></view>
    <view id="goods-2"></view>
    <view class="container-body-box-item"></view>
    <view id="goods-3"></view>
    <view class="container-body-box-item"></view>
   
   

but the actual output looks like this:

    <view class="container-body-box-item"></view>        
    <view class="container-body-box-item"></view>
    <view class="container-body-box-item"></view>
    <view id="goods-1"></view>
    <view id="goods-2"></view>
    <view id="goods-3"></view>
    

how to ask for advice?

Jun.22,2021

Hello, change the code you posted wx:key= "{[index}}" , which should be wx:key= "{{index}}" . You can output the desired results in your own way. The data format of list is as follows:

  

is not possible. The landlord should have written something wrong and didn't find it

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35baa-2bfad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35baa-2bfad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?