The problem of weex registering listening events in activity

in WXPageActity

clipboard.png


weexjs

clipboard.png

Mar.14,2021

1. Take a look at the modal.toast () source code.
2. Component encapsulation is good, but it can confuse the listening of events.
3. It's best to modify the component yourself. Anyway, pay attention to the event-related handling code


globalEvent.addEventListener, which is written to the created method


.

I can't listen in this way because wsdkinstance is not caused by one. We should use minstance to register this monitor. You can see that there is a minstance in the inherited class that has been registered. You can use it directly

clipboard.png

clipboard.png

Menu