收藏
回答

页面怎么没有显示?

<view class="content">

  <view class="content-left">

    <block wx:for="{{list}}" wx:key="list">

      <template is='item-datadata='{{...item}}' wx:if="{{inde % 2==0}}"></template>

    </block>

  </view>

  <view class="content-right">

    <block wx:for="{{list}}" wx:key="list">

      <template is='item-datadata='{{...item}}' wx:if="{{inde % 2==1}}"></template>

    </block>

  </view>

</view>



<template name="item-data">

  <view class="content-item">

    <image src="{{url}}" class="content-item-imgmode="widthFix" />

    <view class="content-item-box">

      <view class="content-item-title">{{title}}</view>

      <view class="content-item-name">

        <view class="flex">

          <image src="{{avatar}}" class="content-item-avatarmode="aspectFill" />

          <view>{{name}}</view>

        </view>

        <view class="content-item-num">{{num}}</view>

      </view>

    </view>

  </view>

</template>


 data: {

    list:[

      {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      },

      {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }, {

        name:'song',

        num:'10',

        title:'他真的很帅',

        url:'https://img01.yzcdn.cn/vant/cat.jpeg',

        avatar:'https://img01.yzcdn.cn/vant/cat.jpeg'

      }

    ]

  }


回答关注问题邀请回答
收藏

1 个回答

  • optimistic
    optimistic
    2023-10-25

    是 index 不是 inde 你的 wx:if 目前永远是false 肯定不显示了,你可以先把 判断条件删掉调试

    2023-10-25
    有用
    回复
登录 后发表内容