i***@aliyun.com
i***@aliyun.com
  • 发布:2023-11-22 16:05
  • 更新:2023-11-22 16:33
  • 阅读:220

h5模式uni build构建后,运行时uni对象下面丢失好多方法

分类:uni-app

uniapp h5使用uni build --mode xxx构建后,在运行时uni这个对象下面只有跟路由相关的几个方法,如果引入的第三方npm包调用了uni.xxx,就会报uni.xxx is not a function的错误

build

但如果是uni --mode xxx这种本地开发运行的时候,uni对象下面的方法就是和文档上一样正常的

no-build

一些uni相关的库版本:
"@dcloudio/uni-app": "3.0.0-3070320230222002",
"@dcloudio/uni-app-plus": "3.0.0-3070320230222002",
"@dcloudio/uni-components": "3.0.0-3070320230222002",
"@dcloudio/uni-h5": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-alipay": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-baidu": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-lark": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-qq": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-toutiao": "3.0.0-3070320230222002",
"@dcloudio/uni-mp-weixin": "3.0.0-3070320230222002",
"@dcloudio/uni-quickapp-webview": "3.0.0-3070320230222002",
"@dcloudio/uni-ui": "^1.4.26",

2023-11-22 16:05 负责人:无 分享
已邀请:
DCloud_heavensoft
8***@qq.com

8***@qq.com - 专治微信小程序疑难杂症: 微信:zicheng199907

h5得遵循h5的规则

要回复问题请先登录注册