当前位置: 首页 > news >正文

uniapp 问题汇总-问题数(2)

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>
http://www.lryc.cn/news/290848.html

相关文章:

  • [AG32VF407]国产MCU+FPGA Verilog编写控制2路gpio输出不同频率方波实验
  • python coding with ChatGPT 打卡第15天| 二叉树:翻转二叉树、对称二叉树
  • Python(19)Excel表格操作Ⅰ
  • HiveSQL题——聚合函数(sum/count/max/min/avg)
  • 计算机是什么做的
  • C++多线程1(复习向笔记)
  • 代理IP在游戏中的作用有哪些?
  • SVN Previous operation has not finished; run ‘cleanup‘ if it was interrupted
  • MATLAB知识点:MATLAB的文件管理
  • 【深度学习】MNN ImageProcess处理图像顺序,逻辑,均值,方差
  • 代码随想录算法训练营29期Day35|LeetCode 860,406,452
  • 20240130金融读报1分钟小得01
  • 刷力扣题过程中发现的不熟的函数
  • native2ascii命令详解
  • 什么是Vue Vue入门案例
  • 【C/Python】GtkApplicationWindow
  • SpringBoot自定义全局事务
  • 【FINEBI】finebi中常用图表类型及其适用场景
  • Kaggle竞赛系列_SpaceshipTitanic金牌方案分析_数据分析
  • Tortoise-tts Better speech synthesis through scaling——TTS论文阅读
  • 单元测试工具JEST入门——纯函数的测试
  • Elasticsearch Windows版安装配置
  • 安装 vant-ui 实现底部导航栏 Tabbar
  • GitHub国内打不开(解决办法有效)
  • Unity之第一人称角色控制
  • 23种设计模式-结构型模式
  • python -- 流程控制
  • Centos 7.9 在线安装 VirtualBox 7.0
  • mysql之基本查询
  • 鸿蒙(HarmonyOS)项目方舟框架(ArkUI)之DataPanel组件