Solution to the problem that the display:flex setting of the scroll-view component of the WeChat applet does not take effect

Problem Description

提示:这里描述项目中遇到的问题:

Recently, I used the scroll-view component when developing small programs, and found that setting display:flex did not take effect.

solution:

This bug existed before. I originally planned to wrap a layer of view in scroll-view and set display:flex.
After checking the WeChat developer documentation, I found something new. I only need to set enable-flex.

<scroll-view 
    scroll-x="true" 
    enable-flex
    scroll-left="{
    
    {scrollLeft}}">
</scroll-view>

Insert image description here

In conclusion, if you encounter problems in mini program development, please read the documentation. Maybe some bugs in the mini program have been officially fixed.

Guess you like

Origin blog.csdn.net/to_prototy/article/details/132570986