A few days ago in the development of registration function, need to play a Modal display of registration protocol, because the protocol text is very long, need users to manually slide view.

Then set height and overflow-y: auto. After setting this, swipe ok on wechat development tool with mouse wheel, but test it on real phone two days later. No matter how hard I try, I can’t move my fingers.

After a careful (random) debugging, the final use of scroll view to solve the problem.

<scroll-view class="content-container" :scroll-y="true">. content</scroll-view>
Copy the code

Note: When using vertical scrolling, you need to give a fixed height, using CSS to set height.

.content-container {
  height: 450rpx;
}
Copy the code

More introduction about scroll – view, please click uniapp. Dcloud. IO/component/s…

Here is a question: why does overflow: Auto not allow gesture sliding, but Scroll view does? I have not thought of the reason for the moment, welcome to know the reason of the friends to answer the message, thank you!!