Problems encountered in development and solutions

1. The console reports can not resolve the corresponding package name problem

Solutions:

1) Look for the package in the node_modules folder, if not, install the plug-in, and whether the project reports an error when running

2) If it is determined that the plug-in is installed under node_modules, check whether the alias of the package is used, and the alias is configured under the alias attribute in the configuration

 

2. The page has height: fixed value, overflow: scroll, but when the content exceeds the set height value, it cannot be scrolled

Generally, a fixed height value is set for a container, overflow: scroll When the content height exceeds the set value, a scroll bar will appear and the page can be scrolled. But it can’t scroll here

Ideas for troubleshooting:

Elimination can be used

1) Write a fixed height value in the DOM that exceeds the value set by the container, and annotate the elements in the DOM a little bit to see which DOM element affects

2) When you find the affected DOM, see if it is caused by its css, if not, see if there are any settings in the JS, such as preventing default events and preventing bubbling events

The problem I encountered was caused by: when created, the touchmove event listener was added to the body. Once the event is triggered, the default event is prevented: event.preventDefault()

When the content of the element on the page exceeds a fixed height, we want to slide down to see the occluded content, we need to trigger the page sliding event, and the sliding event is forbidden, and the page cannot scroll naturally.

Guess you like

Origin blog.csdn.net/tangxiujiang/article/details/110289248