e.stopPropagation() is invalid in uni-app, only stop can be used, the resulting problem

The uni-app WeChat applet with the sliding effect of the dashboard before   , because the page will shake when swiping on the Apple mobile phone, so this part prevents the bubbling of the sliding event. Originally, there is no problem if the page is less than one screen, but it fails. After the new requirements, the page needs to be scrolled up and down, which makes it impossible to scroll the page by sliding up and down on the dashboard, which is very inconvenient to operate.

Option 1: I want to use e.stopPropagation() to dynamically prevent bubbling in the sliding event method, but I found that this is not supported in uni-app, and only stop can be used, so it is not possible;

Option 2: Copy a dashboard html code, the first one is displayed by default and does not prevent bubbling; the second is displayed when the sliding button is pressed, preventing bubbling; I thought this would be enough, but after trying it, I found that every The sliding event will not be triggered the first time of the second sliding, it should be caused by switching the displayed html, so it will not work either;

After thinking about it for more than an hour, I suddenly found that as long as you start sliding in the node that monitors the sliding, no matter where you slide, you can trigger the sliding event of the node, so everything is simple.

Option 3: Just put the sliding listener event on the button that needs to be slid;

 

 This may be the price to pay for a weak foundation.

Guess you like

Origin blog.csdn.net/qq_18676843/article/details/123128161