wx:for

发布于 6 年前作者 lei9916667 次浏览最后编辑 6 年前来自 ask

微信小程序怎么给for循环的view点击改变其他view事件

<view wx:for=“{{cardLists}}” wx:key=“{{item.Id}}” class=“cardlist”>

    <!-- 卡内容 –>

    <view class=“listbtm”>

        <view class=“lbinfo lrt” bindtap=ShowView”>

            <image src=“/images/moreinfo.png”></image>

            <label>更多信息</label>

        </view>

        <view class=“lbinfo”>

            <image src=“/images/xfjl.png”></image>

            <label>消费记录</label>

        </view>

    </view>

    <!-- 卡隐藏内容 –>

    <view class=“listhide”>

   </view>

</view>

如何通过  ShowView  事件改变  listhide 的显示和隐藏

2 回复
icao
icao1 楼6 年前

而且 id=“{{index}}” 没数据    data-id=“{{index}}” 也没数据

jiejin
jiejin2 楼4 年前

我的

json 里没有hidden  字段,用别的字段代替显示


WAService.js:3 thirdScriptError

Cannot read property ‘0’ of undefined;at pages/cards/cards page ShowView function

TypeError: Cannot read property ‘0’ of undefined