Skip to content

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

Description

@tom-hanks

大家直接在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}, 完美解决

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions