ios scroll-view无法滚动 使用uview折叠面板嵌套scroll-view
嵌套之后安卓可以滚动,ios无法滚动
<u-collapse accordion @open='collapseOpen' @change='collapseChange' ref="uCollapse" :value='uCollapseValue'>
<u-collapse-item :name='index' :title="item.text+' ('+item.num+'张) '" v-for="item,index in voucherCate"
:key="index">
<view class="u-collapse-content" v-if="openList==index"
:style="{'height':`calc( 100vh - 88rpx - 170rpx - ${voucherCateLength * 82 }rpx - ${calculateStatusBar})`}">
<scroll-view scroll-y="true" class="scroll-view " :enhanced="true" :bounces="false"
:refresher-enabled='enabled' refresher-default-style='none' @refresherrefresh='refresh'
@refresherpulling='pulling' @scroll='scroll' :refresher-triggered='triggered'
@refresherrestore='store' @scrolltolower='scrollBottom'>
<view
:style="{background: 'url('+wanhaoCard+') #FFF no-repeat center center',backgroundSize:'100% 100%'}"
class="brokers-box-c" v-for="(item,index) in brokersList" :key="index"
@click="onBrokers(item,index)">
<view class="brokers-box-r justify-between align-center">
<view v-if="checked==0" class="go-use justify-center align-center"
@click="onBrokers(index)">
去使用
</view>
</view>
</view>
</scroll-view>
</view>
</u-collapse-item>
</u-collapse>
原因是动态设置scroll-view高度的时候将高度错误
错误代码
:style="{'max-height':`calc( 100vh - 88rpx - 170rpx - ${voucherCateLength * 82 }rpx - ${calculateStatusBar})`}">
正确ios代码 解决
:style="{'height':`calc( 100vh - 88rpx - 170rpx - ${voucherCateLength * 82 }rpx - ${calculateStatusBar})`}">
页面跳转失效
报错代码
[Vue warn]: Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.
at <Tabbar__pageId=6__pagePath="pages/tabbar/tabbar"__pageQuery={} ...>
找到问题代码
<mine v-if="PageCur==1" ref='mine'></mine>
解决问题 问题的原因是因为vue3的ref如果使用在setup里要声明对应的
<mine v-if="PageCur==1" ></mine>