<view class="box1" hover-class="box1-active">
<view class="box" hover-class="box-active" hover-stop-propagation></view>
</view>
<style>
.box1{
height: 200px;
width: 200px;
background-color:grey
}
.box{
height: 100px;
width: 100px;
background-color: aquamarine;
}
.box-active{
background-color: palevioletred;
}
.box1-active{
background-color: blue;
}
</style>
点击子元素的时候不会影响父元素
点击父元素的时候不会影响子元素
注意是在子元素加hover-stop-propagation