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
同一个页面的配置,在不同小程序平台上某些配置是不一样的,比如导航栏风格: 微信、支付宝: navigationStyle: 'custom' 抖音: navigationStyle: 'default'
1).config.js文件能支持多端。 2)或者definePageConfig定义的页面配置对象能支持使用变量。
The text was updated successfully, but these errors were encountered:
已经找到解决方案了,虽然definePageConfig定义的页面配置对象不能使用变量,但取值时可以使用process.env.TARO_ENV !== 'tt'判断。比如: export default definePageConfig({ navigationStyle: process.env.TARO_ENV !== 'tt' ? 'custom' : 'default', transparentTitle: "auto" })
但其实还是不够灵活,如果条件更复杂的话可读性就差很多了。
Sorry, something went wrong.
https://docs.taro.zone/docs/next/envs#%E5%A4%9A%E7%AB%AF%E7%BB%84%E4%BB%B6
你可以同时建个 tt.config.ts 给抖音小程序使用
tt.config.ts
No branches or pull requests
这个特性解决了什么问题?
同一个页面的配置,在不同小程序平台上某些配置是不一样的,比如导航栏风格:
微信、支付宝: navigationStyle: 'custom'
抖音: navigationStyle: 'default'
这个 API 长什么样?
1).config.js文件能支持多端。
2)或者definePageConfig定义的页面配置对象能支持使用变量。
The text was updated successfully, but these errors were encountered: