1***@qq.com
1***@qq.com
  • 发布:2020-07-26 00:42
  • 更新:2022-07-17 15:05
  • 阅读:5985

Component "pages/index/shouquan" does not have a method "tap" to handle event "tap"

分类:uni-app

编译到微信小程序,总是提示这个,Component "pages/index/shouquan" does not have a method "tap" to handle event "tap"
以下是代码:
<template>
<view>
<rich-text :nodes="nodes" bindtap="tap"></rich-text>
</view>
</template>

<script>
export default {
data() {
return {
nodes: [
{
name: 'div',
attrs: {
class: 'div_class',
style: 'line-height: 60px; color: red;'
},
children: [
{
type: 'text',
text: 'Hello World!'
},
{
name:"img",
attrs: {
style: 'width: 100px;',
src:'http://photocdn.sohu.com/20120910/Img352705474.jpg'
},
}
]
},
]
}
},
methods: {
tap() {
console.log('tap')
}
}
}
</script>

<style>

</style>

转到微信小程序后,运行点击就会出现上面的提示。

2020-07-26 00:42 负责人:无 分享
已邀请:
厉白竹

厉白竹

有的时候不能用bind绑定事件,不然编译到小程序就报这个错,但是用@就可以。

1***@qq.com

1***@qq.com (作者)

上传个附件,

要回复问题请先登录注册