Skip to content
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

关于在app.config.ts/js里配置usingComponents的解决方案 #83

Open
tom-hanks opened this issue Mar 27, 2023 · 0 comments
Open

关于在app.config.ts/js里配置usingComponents的解决方案 #83

tom-hanks opened this issue Mar 27, 2023 · 0 comments

Comments

@tom-hanks
Copy link

tom-hanks commented Mar 27, 2023

大家直接在app.config.ts或者app.config.js里写如下代码

export default defineAppConfig({
  pages: [
    'pages/chat/chat',
    'pages/index/index',
  ],
  window: {
    backgroundTextStyle: 'light',
    navigationBarBackgroundColor: '#fff',
    navigationBarTitleText: 'WeChat',
    navigationBarTextStyle: 'black'
  },
  usingComponents: Object.assign({
    iconfont: `components/iconfont/${process.env.TARO_ENV}/${process.env.TARO_ENV}`,
  })
})

usingComponents和window同级,引入的话不要引入helper文件,会报错的,,直接在这里配置 iconfont: components/iconfont/${process.env.TARO_ENV}/${process.env.TARO_ENV}, 完美解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant