<view wx:if="{{index<=3}}" class="comment-item" hover-class="click" catchtap="onMsgClick">
<view class="comment-user" hover-class="click" catchtap="onUserClick">{{cName}}</view>
<view wx:if="{{comment.to}}" hover-class="click" class="comment-user " catchtap="onUserClick">{{nickName}}</view>
{{descript}}</view>
每次点击里层view时,外层view的hover-class 也会起作用 我想要的效果是点击在哪层view上只有点击的这层有效果
嵌套出现问题,内部组件不出效果, hover-stop-propagation 属性没问题
代码如下:
<view class=“flex-wrp” style=“flex-direction:row;”>
<view class=“flex-item demo-text-1 flex-box” hover-class=“demo-text-2”>
<view class=“second demo-text-2” hover-class=“demo-text-1” hover-stop-propagation></view>
<view class=“second demo-text-3” hover-class=“demo-text-2”></view>
</view>
<view class=“flex-item demo-text-2”></view>
<view class=“flex-item demo-text-3”></view>
</view>
说明:
上面代码是在体验小程序的源码基础上更改的,在flex-item里追加了两个view,这两个view的hover-class属性不起作用