button的触发范围出现bug

发布于 8 年前作者 fangfu13514 次浏览最后编辑 8 年前来自 ask

详细问题描述

在微信小程序中,点击button 之外的其他组件,都能触发button

[可重现代码片段]

<template> 
    <view> 
        <button @click="abc">12213213</button>   
        <view>么么么么么么么木木木木木木木木木木</view> 
    </view> 
</template> 
 
<script> 
      methods: { 
            abc(){ 
                console.log(11111111111) 
            } 
        } 
</script> 
 
<style scoped> 
</style>

[详细描述]


点击么么么么么么么木木木木木木木木木木 能够触发 abc()方法   并在console台能够打印出11111111111

2 回复
ylu
ylu1 楼6 年前

可以看下样式是啥样的么?是不是button盖在view上了?

hanyang
hanyang2 楼6 年前

你别用框架,写原生的看能不能在button外触发?如果不能,建议甩第三方的锅