taro启用组件按需注入

返回
Author Avatar
钢翼
2023-07-30
编程
224

app.config.ts中添加 lazyCodeLoading: "requiredComponents",

如下

export default defineAppConfig({
  lazyCodeLoading: "requiredComponents",
  pages: [
    "pages/login/index",
    "pages/index/index"
  ],
  window: {
    backgroundTextStyle: "light",
    navigationBarBackgroundColor: "#fff",
    navigationBarTitleText: "WeChat",
    navigationBarTextStyle: "black"
  }
})