Detailed vue in the event modifier (stop, prevent, self, once, capture, passive)
Others
2019-09-24 22:44:27
views: null
==. Stop == is to prevent bubbling behavior, not to continue the current event element out triggers, such as clicking div prevent internal event, event trigger div
==. Self == is triggered only own their own will be implemented, if the received signal transmission inside the bubbling event is triggered, it will ignore the signal
==. Capture == js change the default event mechanism, the default is bubbling, capture function is changed to listen to the bubbling mode
==. Once == event is set once, when the second shot acts as the event itself will perform only once, such as .click.prevent.once representatives only prevent event's default behavior
.passive and .prevent not be used together:
.self and .stop difference:
- self only respond to events triggered by the current element itself, it will not trigger a response after the event bubbling, and will not stop bubbling continue to trigger to the outside.
- stop itself starts from the bubbling to the outside is not emitted signal
I feel a small partner to help point a praise ~
Origin www.cnblogs.com/zheroXH/p/11578719.html