uniapp h5使用uni build --mode xxx构建后,在运行时uni这个对象下面只有跟路由相关的几个方法,如果引入的第三方npm包调用了uni.xxx,就会报uni.xxx is not a function的错误
但如果是uni --mode xxx
这种本地开发运行的时候,uni对象下面的方法就是和文档上一样正常的
一些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",
i***@aliyun.com (作者)
确实如此,谢谢大佬
2023-11-22 16:46