如图:
<template>
<scroll-view :style="{height: scrollHeight}" class='scroll_left' scroll-y="true">
</template>
<script>
that.scrollHeight = uni.getSystemInfoSync().windowHeight - 44 + 'px'
// 44 是我顶部搜索的高度
</script>
另外分享一下获取元素的信息代码
mounted() {
const query = uni.createSelectorQuery().in(this);
query.select('#search').boundingClientRect(data => {
console.log(data)
}).exec();
},