wx:for循环数据变更时报错:nodeId is not defined
发布于 5 年前 作者 liaoxiulan 11512 次浏览 来自 问答

使用wx:for循环时,数据在逻辑处理下变更长度,导致console控制台报下面错了,在所有自己写的代码和逻辑中都没有使用过 nodeId 这个变量,想问下这个应该怎么处理,在客户端和工具中都能看到这个报错

核心代码:

<view class=‘bottomline’ wx:if="{{roompeoples.length > 0}}" wx:for="{{roompeoples}}" wx:key=“key”>

    <text class=‘name’>{{item.name}}</text><text data-key=’{{index}}’ wx:if="{{!item.me}}" class=‘btncli {{item.isVoce?“onvoice”:“novoice”}}’ bindtap=‘changelisten’>静音</text>

    <live-player style=“width:1px;height:1px;” id="{{item.id}}" wx:if="{{item.rtmpDownUrl}}" src="{{item.rtmpDownUrl}}" mode=“RTC” autoplay bindstatechange=“statelivechange” binderror=“liveerror” />

  </view>

报错信息:

ReferenceError: nodeId is not defined

    at http://127.0.0.1:59565/appservice/__dev__/WAService.js:7:30276

    at e.(anonymous function) (http://127.0.0.1:59565/appservice/__dev__/WAService.js:4:4785)

    at a (http://127.0.0.1:59565/appservice/appservice:1053:9451)

    at e.registerCallback (http://127.0.0.1:59565/appservice/appservice:1053:9638)

    at m.forEach (http://127.0.0.1:59565/appservice/appservice:1053:5612)

    at Array.forEach (<anonymous>)

    at d (http://127.0.0.1:59565/appservice/appservice:1053:5592)

    at WebSocket.j.onmessage (http://127.0.0.1:59565/appservice/appservice:1053:5485)

回到顶部