2***@qq.com
2***@qq.com
  • 发布:2025-01-07 17:12
  • 更新:2025-01-08 18:18
  • 阅读:53

【报Bug】nvue 跳转 另一个预加载的 nvue 页面之后,打开 popup 组件报错,且 popup 样式异常

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版 22H2(19045.4780)

HBuilderX类型: Alpha

HBuilderX版本号: 4.43

手机系统: Android

手机系统版本号: Android 15

手机厂商: 小米

手机机型: 红米 K70

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

A 页面(tabbar页面)

onLoad(() => {  
    uni.preloadPage({url: "/pages/wallet/withdraw/record"})  
})

B 页面

 <u-popup :show="isShowStatusPicker" mode="top" :round="8" @close="isShowStatusPicker = false">  
        <u-navbar title="提现记录" bg-color="#fff"></u-navbar>  
    <view class="status-picker">  
      <view class="filter">  
                <view class="filter-item" @click="isShowStatusPicker = false">  
                    <text class="filter-item-text">提现状态:{{ statusList[currentStatusIndex].label }}</text>  
                    <m-icon name="arrow-top-fill" color="#333" :size="10"></m-icon>  
                </view>  
            </view>  
            <view class="list">  
                <view class="list-item" :class="{active: index === currentStatusIndex, nomargin: (index+1)%4===0}" v-for="(item, index) in statusList" :key="index" @click="currentStatusIndex = index">  
                    <text class="list-item-text" :class="{active: index === currentStatusIndex }">{{item.label}}</text>  
                </view>  
            </view>  
            <view class="action">  
                <m-button text="取消" :customStyle="btnStyle" @click="isShowStatusPicker = false"></m-button>  
                <m-button text="确认" type="primary" bold :customStyle="btnStyle" @click="setStatus"></m-button>  
      </view>  
    </view>  
  </u-popup>

操作步骤:

A nvue 跳转预加载的 B nvue 后打开 popup

预期结果:

打开 popup 不报错,样式正常显示

实际结果:

打开 popup 报错,样式异常

bug描述:

两个都是 nvue 页面,由于 A 页面跳转到 B 页面会有一段短暂的白屏所以用了预加载,白屏问题是解决了但是打开 B 页面中的 popup 时报错了,且 popup 的圆角失效了,里面的 navbar 组件也消失了。修改代码热更新后再次报错,A 页面直接白屏(图片上传后点击插入无反应所以没有图)
如果 B 页面不使用预加载或换成 vue 则不存在此问题

报错

16:47:03.126 [Vue warn]: Unhandled error during execution of render function  
 at <UNavbartitle="提现记录"bg-color="#fff">  
 at <UTransitionshow=truecustomStyle={"zIndex":10075,"position":"fixed","display":"flex","top":0,"left":0,"right":0}mode="slide-down" ...>  
 at <UPopupshow=truemode="top"round=8 ...>  
 at <Record__pageId=4__pagePath="pages/wallet/withdraw/record"__pageQuery={}>  
16:47:03.126 TypeError: e.$getAppWebview is not a function  
16:47:03.126 [Vue warn]: Unhandled error during execution of render function  
 at <USafeBottomkey=2>  
 at <UTransitionshow=truecustomStyle={"zIndex":10075,"position":"fixed","display":"flex","top":0,"left":0,"right":0}mode="slide-down" ...>  
 at <UPopupshow=truemode="top"round=8 ...>  
 at <Record__pageId=4__pagePath="pages/wallet/withdraw/record"__pageQuery={}>  
16:47:03.126 TypeError: e.$getAppWebview is not a function  

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: e.$getAppWebview is not a function  
 at wf (uni-jsframework.js:45:123029)  
 at  (uni-jsframework.js:45:123831)  
 at  (uni-jsframework.js:45:254)  
 at  (uni-jsframework.js:45:126105)  
 at  (uni-jsframework.js:45:254)
2025-01-07 17:12 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com (作者)

2***@qq.com

2***@qq.com (作者)

评论可以正常插入图片

2***@qq.com

2***@qq.com (作者)

所以现在 nvue 的 bug 也直接不管了是吗

要回复问题请先登录注册