开发学院

您的位置:首页>技术文章>正文

技术文章

uniapp启用微信小程序按需注入

开发学院2024-01-22 16:56:29

  HBuilder X中找到项目的manifest.json,进入源码视图,找到mp-weixin部分,在下面增加

lazyCodeLoading":"requiredComponents"


以下是完整的代码

/* 小程序特有相关 */
    "mp-weixin" : {
        "appid" : "xxxxxx",
        "setting" : {
            "urlCheck" : false
        },
        "usingComponents" : true,
        "lazyCodeLoading" : "requiredComponents"
    },

最后发布为微信小程序就可以检测通过。