wx:for
发布于 5 年前 作者 lei99 16488 次浏览 来自 问答

微信小程序怎么给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 回复

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

我的

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


回到顶部