1***@qq.com
1***@qq.com
  • 发布:2022-08-13 14:14
  • 更新:2022-08-15 14:33
  • 阅读:432

【报Bug】nvue 子组件mounted异常

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 21H2

HBuilderX类型: 正式

HBuilderX版本号: 3.5.4

手机系统: iOS

手机系统版本号: iOS 14

手机厂商: 苹果

手机机型: iphone Xs max , iphone13

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

已上传附件

操作步骤:

nvue页面使用多个子组件,其中一个子组件使用 watch 中使用 immediate 并且 实现 mounted

预期结果:

正常不报错

实际结果:

报错[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

bug描述:

在nvue中 子组件 watch 中使用 immediate 并且 实现 mounted ,ios报错

2022-08-13 14:14 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

是不是在异步函数中执行 onMounted 了?请保证在第一个 await 之前执行 onMounted 生命周期钩子

  • 1***@qq.com (作者)

    没有写异步函数

    2022-08-15 14:40

  • 1***@qq.com (作者)

    跑一下附件的代码应该可以复现出来android是正常的ios报错

    2022-08-15 14:43

要回复问题请先登录注册