页面这样写没问题
<template>
<view class="content">
<scroll-view scroll-y="true" >
<view class="scroll"></view>
</scroll-view>
</view>
</template>
<script setup>
import{ onMounted,nextTick} from 'vue'
onMounted(()=>{
nextTick(()=>{
const query = uni.createSelectorQuery();
query.select('.scroll').boundingClientRect();
query.exec((res) => {
console.log('page的res',res);
});
})
})
</script>
<style>
</style>