收藏
回答

点快了就报的错

点快了就报着个错,我该怎么 修改?

thirdScriptError
Cannot set property 'classname' of undefined; [Component] Event Handler Error @ pages/games/game#bound gameda
TypeError: Cannot set property 'classname' of undefined
    at ye.gameda (http://127.0.0.1:63953/appservice/pages/games/game.js:270:36)
    at Object.r.safeCallback (WAService.js:1:857898)
    at WAService.js:1:1048426
    at r (WAService.js:1:982076)
    at WAService.js:1:982184
    at WAService.js:1:253666
    at n (http://127.0.0.1:63953/appservice/appservice?t=1562135087132:1159:27752)
    at e.exports.<anonymous> (http://127.0.0.1:63953/appservice/appservice?t=1562135087132:1159:28094)
    at http://127.0.0.1:63953/appservice/appservice?t=1562135087132:1159:13287
    at Array.forEach (<anonymous>)
console.error @ VM692:1
errorReport @ WAService.js:1
thirdErrorReport @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
r.safeCallback @ WAService.js:1
r.call @ WAService.js:1
message @ WAService.js:1
r.safeCallback @ WAService.js:1
(anonymous) @ WAService.js:1
r @ WAService.js:1
(anonymous) @ WAService.js:1
(anonymous) @ WAService.js:1
n @ appservice?t=1562135087132:1159
(anonymous) @ appservice?t=1562135087132:1159
(anonymous) @ appservice?t=1562135087132:1159
_ws.onmessage @ appservice?t=1562135087132:1159
回答关注问题邀请回答
收藏

1 个回答

  • 是小白啊
    是小白啊
    2019-07-03

    检查下这个变量

    2019-07-03
    有用
    回复 1
    • 走走
      走走
      2019-07-03

      <view class='{{item.classname}}' > 这个是data中的原始值

      {

              word1: "Pedestrian\r\n Street",

              classname: 'text-bg',

              pipei: "8",

              textfonname: 'text-fon',

              flag: true

            }, 这个是点击事件里面不同条件下的改值

      wordMsg[g1].classname = 'text-bg1';

      wordMsg[value_1].classname = 'text-bg2';

          

      wordMsg[value_1].classname = 'text-bg';

      wordMsg[value_1].classname = 'text-bg3';

      wordMsg[value_1].classname = 'text-bg';


      这样写有什么问题吗?

      2019-07-03
      回复
登录 后发表内容