详细问题描述
钉钉小程序有时候无法触发@click事件并报错
支付宝小程序无此问题,只有钉钉小程序会报错
重现步骤
运行到支付宝开发者工具并选择钉钉第三方个人应用
模拟器上点击设置了事件的view,结果报错
Error: triggerComponentEvent error: Cannot read property '$options' of undefined - eventName: __e - type: [object Function]
at PageComponent.triggerComponentEvent (af-appx.worker.ide.js:1058)
at PageComponent.onMessage (af-appx.worker.ide.js:1739)
at Object.fn (bridge.js:1)
at HTMLDocument.document.dispatchEvent (bridge.js:1)
at <anonymous>:1:10
setTimeout (async)
g.setTimeout @ af-appx.worker.ide.js:2581
s.(anonymous function) @ bridge.js:1
document.dispatchEvent @ bridge.js:1
(anonymous) @ VM142:1
WebFrame.(anonymous function) @ VM101 D:\Program Files\支付宝小程序开发者工具\resources\electron.asar\renderer\api\web-frame.js:56
electron.ipcRenderer.on @ VM83 D:\Program Files\支付宝小程序开发者工具\resources\electron.asar\renderer\web-frame-init.js:36
emit @ VM18 events.js:182
[WORKER] onerror Error: triggerComponentEvent error: Cannot read property '$options' of undefined - eventName: __e - type: [object Function]
at PageComponent.triggerComponentEvent (af-appx.worker.ide.js:1058)
at PageComponent.onMessage (af-appx.worker.ide.js:1739)
at Object.fn (bridge.js:1)
at HTMLDocument.document.dispatchEvent (bridge.js:1)
at <anonymous>:1:10
IDE运行环境说明
HBuilderX:2.4.1.20191114
windows版本号:10.0.18362 版本 18362
uni-app运行环境说明
钉钉小程序第三方个人应用
小程序开发者工具Version 0.70.14
HBuilderX创建的
自定义组件模式
附件
代码
<view v-for="(item,index) in list" style="width: 682rpx;margin-bottom: 28rpx;" :key="index">
<view @click="changeVisibleOfList(index)" class="flex-row-start" style="margin-top: 36rpx;">
...
</view>
...
</view>
changeVisibleOfList(index) {
console.log(index)
var temp = this.list.slice()
temp[index].visible = !temp[index].visible
this.list = temp
},
zxcvb (作者)
是的
2019-11-15 17:11
DCloud_UNI_HT
回复 zxcvb: 下载或更新最新版本的HBuilderX 试一下
2019-11-15 17:13
zxcvb (作者)
回复 DCloud_UNI_HT: 已经是最新版了,今天刚更新的
2019-11-15 17:16