1***@qq.com
1***@qq.com
  • 发布:2025-06-18 16:00
  • 更新:2025-06-18 16:28
  • 阅读:44

uniapp 在onShow使用getCurrentPages会出现报错

分类:HBuilderX

我用的红米k80真机跑的,用的基座是标准基座,使用的vue2,在进入页面的时候调用getCurrentPages这个方法会报错误 Property or method "toJSON" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

2025-06-18 16:00 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者) - null

@DCloud_HB_GX @DCloud_UNI_yuhe

1***@qq.com

1***@qq.com (作者) - null

hbuildx版本是4.66版本

  • DCloud_UNI_yuhe

    稳定复现吗?重新运行一下或者删除 unpackage 试过吗?运行到安卓模拟器呢?

    2025-06-18 16:19

DCloud_UNI_yuhe

DCloud_UNI_yuhe

使用的是哪个版本的hbuilderx?

蔡cai

蔡cai - 开发的插件:https://ask.dcloud.net.cn/article/41539

你把console.log打印getCurrentPages()的注释掉还会吗

  • 蔡cai

    或者注释掉getCurrentPages相关的,看还会报错嘛

    2025-06-18 16:28

要回复问题请先登录注册