-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: uniapp 环境打包 h5。会注入 wx 全局变量。导致zrender 判断认为微信环境,从而引起echarts 功能异常 #1024
Comments
建议加上 uni 判断,或者其他Env 判断方式。避免wx 污染从而引起判断bug |
This was referenced Jul 27, 2023
临时解决方案。import 改为 require 方式。加入如下 hack 代码 let fn = null;
if (typeof uni !== "undefined" && typeof wx !== "undefined") {
fn = wx.getSystemInfoSync;
wx.getSystemInfoSync = null;
}
const echarts = require("echarts");
if (fn) {
wx.getSystemInfoSync = fn;
fn = null;
} |
添加这段代码问题依旧。 |
感谢,困扰了我大半天的问题终于找到原因所在了。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
uniapp 环境打包 h5。会注入 wx 全局变量。导致zrender 判断认为微信环境,从而引起echarts 功能异常
The text was updated successfully, but these errors were encountered: