uniapp 事件和阻止冒泡
<template><view><view class="box1" @tap.stop="box1event()">外面<view class="box2" @tap.stop="box2event()">里面</view></view></view></template><script>
·
<template>
<view>
<view class="box1" @tap.stop="box1event()">
外面
<view class="box2" @tap.stop="box2event()">里面</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
name:"哈哈哈"
}
},
methods:{
clickevent:function(){
this.name="嘻嘻嘻";
},
box1event:function(){
console.log("点击了外面");
},
box2event:function(){
console.log("点击了里面")
}
}
}
</script>
更多推荐
所有评论(0)