WeChat Mini Programs clicks on the view tag that binds the click event. Is there no prompt for click effect by default?

for example, when I bind a click event to a view tag, and then click with my finger, there is no click effect. I remember that in ordinary web development, when the element bound to the click event is clicked, there will be a light gray background prompt. Mini Program does not have this kind of click feedback to users, it feels so awkward, how can we achieve similar click feedback?


clipboard.png


< del > set the wxss style for view < / del >

.XXX:active{
    ...
}

it is recommended to implement it in the form of official documents. The above implementation belongs to hack,. It may fail one day

. In

WeChat Mini Programs, you can use the hover-class attribute to specify the click-state effect of an element. However, it should be noted in use that most components do not support this property. Currently, there are three components that support the hover-class attribute: view, button, and navigator.

Menu