We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
H5
浏览器版本: Chrome 89 使用框架: React
非 Taro 构建项目参照 #6883 配置可运行,但使用到 Swiper 时发生异常。
看了下好像是因为没有环境变量时全局的 getComputedStyle 被覆盖了,新的方法在 H5 下行为不太对:
getComputedStyle
taro/packages/taro-runtime/src/bom/window.ts
Lines 25 to 28 in 8c485f8
没有正确获取到样式:
无环境变量时不覆盖全局方法
全局方法被覆盖
Taro CLI 3.0.21 environment info: System: OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver) Shell: 5.4.2 - /usr/bin/zsh Binaries: Node: 12.13.0 - /usr/local/bin/node Yarn: 1.9.2 - /mnt/c/Program Files (x86)/Yarn/bin/yarn npm: 6.12.0 - /usr/local/bin/npm npmPackages: @tarojs/cli: ^3.0.21 => 3.0.21 @tarojs/components: ^3.0.21 => 3.0.21 @tarojs/mini-runner: ^3.0.21 => 3.0.21 @tarojs/react: ^3.0.21 => 3.0.21 @tarojs/runtime: ^3.0.21 => 3.0.21 @tarojs/webpack-runner: ^3.0.21 => 3.0.21 babel-preset-taro: ^3.0.21 => 3.0.21 eslint-config-taro: ^3.0.21 => 3.0.21 postcss-pxtransform: ^3.2.1 => 3.2.1 react: ^17.0.2 => 17.0.2
The text was updated successfully, but these errors were encountered:
设置一下环境变量咯
Sorry, something went wrong.
自定义构建设置了环境变量会报另一个问题 .. runtime 里面找不到 React,还不清楚原因 ..
覆盖这里判断下?
if (process.env.TARO_ENV && process.env.TARO_ENV !== 'h5') { }
No branches or pull requests
相关平台
H5
浏览器版本: Chrome 89
使用框架: React
复现步骤
非 Taro 构建项目参照 #6883 配置可运行,但使用到 Swiper 时发生异常。
看了下好像是因为没有环境变量时全局的
getComputedStyle
被覆盖了,新的方法在 H5 下行为不太对:taro/packages/taro-runtime/src/bom/window.ts
Lines 25 to 28 in 8c485f8
表现
没有正确获取到样式:
期望结果
无环境变量时不覆盖全局方法
实际结果
全局方法被覆盖
环境信息
The text was updated successfully, but these errors were encountered: