问题:设置了溢出滚动,显示不全
<div className="active-friends">
<ActiveFriends />
...
<ActiveFriends />
</div>
.active-friends{
overflow-x:scroll
}

解决:在子组件外层再套一层 div
<div className="active-friends">
<div className="scroll-friends">
<ActiveFriends />
...
<ActiveFriends />
</div>
</div>
.scroll-friends{
overflow-x:scroll
}

当设置<div>元素的overflow-x为scroll时,内容显示不全。为了解决这个问题,文章提出了在子组件外层添加一个新的<div>,并给这个新div应用滚动样式。这样可以确保滚动功能正常工作,内容完整显示。
389






