rajanZhan
rajanZhan
  • 发布:2020-07-19 18:56
  • 更新:2021-03-27 22:00
  • 阅读:4409

【报Bug】组件点击事件@click.stop 报错

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 2.7.14

浏览器平台: Chrome

浏览器版本: 版本 83.0.4103.116(正式版本) (64 位)

项目创建方式: HBuilderX

示例代码:

<view style="text-align: right;padding-right: 20rpx;">
<u-button @click.stop="$emit('detail',cardinfo)" style="text-align: center;" type="success" size="mini">阅读详情</u-button>
</view>

操作步骤:

直接点击就报错了

预期结果:

正常

实际结果:

报错

bug描述:

组价使用@click.stop 时报如下的错误

[Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'stopPropagation' of undefined"

found in

---> <UButton> at uview-ui/components/u-button/u-button.vue
<Card> at components/list-card/list-card.vue
<Refresh> at components/refresh/refresh.vue
at pages/index/index.vue
warn @ chunk-vendors.js:3849
e.config.errorHandler @ chunk-vendors.js:10
globalHandleError @ chunk-vendors.js:5112
handleError @ chunk-vendors.js:5081
invokeWithErrorHandling @ chunk-vendors.js:5104
invoker @ chunk-vendors.js:5421
invokeWithErrorHandling @ chunk-vendors.js:5096
Vue.$emit @ chunk-vendors.js:7165
click @ u-button.vue:248
click @ pages-index-index.js:512
invokeWithErrorHandling @ chunk-vendors.js:5096
invoker @ chunk-vendors.js:5421
invokeWithErrorHandling @ chunk-vendors.js:5096
invoker @ chunk-vendors.js:5417
original._wrapper @ chunk-vendors.js:10299
chunk-vendors.js:10 [system] TypeError: Cannot read property 'stopPropagation' of undefined

2020-07-19 18:56 负责人:无 分享
已邀请:
wynn

wynn

可以通过调用原生事件解决。例: @click.native.stop

jxtian

jxtian

这个应该是插件 uviewUI 的组件吧,你给插件开发者反馈一下

jxtian

jxtian

u-button 是你自定义的组件?

  • rajanZhan (作者)

    UI框架的

    2020-07-24 16:15

嗨哆嚒

嗨哆嚒 - 嗨哆嚒

同样的问题,我用的u-icon。使用这个@tap.native.stop= 不会报错,但无效。id属性也无法设置。

该问题目前已经被锁定, 无法添加新回复