<view style="width: 90%;flex: 1;position: relative;"> <scroll-view :scroll-top="scrollTop" scroll-y="true" style="width: 100%;height: 100%;"> 按理说它的上层view是flex:1,scroll-view设置为100%不应该刚好铺满屏幕高度吗?但现在会把页面撑大呢?
可以试一下,外面盒子position: fixed;top: 0px;right: 0px;bottom: 0px;left: 0px; scroll-view的样式:position: absolute;top: 0;right: 0px;bottom: 0px;left: 0px;
3 个回复
爱豆豆 - 办法总比困难多
不能用height: 100%; scroll-view必须要有一个固定高度 如果想要动态高度可以用vh 和calc() 来计算
爱tutu爱生活 - 前端渣渣
可以试一下,外面盒子position: fixed;top: 0px;right: 0px;bottom: 0px;left: 0px;
scroll-view的样式:position: absolute;top: 0;right: 0px;bottom: 0px;left: 0px;
jgj_app
scroll-view 设置 flex:1