提交 b7b354ab 编写于 作者: D DCloud_LXH

fix(mp): 小程序平台使用插槽热更新时,丢失 genericComponents 信息 question/136258

上级 ebbbe353
...@@ -87,6 +87,9 @@ function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Com ...@@ -87,6 +87,9 @@ function updateComponentJson (name, jsonObj, usingComponents = true, type = 'Com
const oldJsonObj = JSON.parse(oldJsonStr) const oldJsonObj = JSON.parse(oldJsonStr)
jsonObj.usingComponents = oldJsonObj.usingComponents || {} jsonObj.usingComponents = oldJsonObj.usingComponents || {}
jsonObj.usingAutoImportComponents = oldJsonObj.usingAutoImportComponents || {} jsonObj.usingAutoImportComponents = oldJsonObj.usingAutoImportComponents || {}
if(oldJsonObj.genericComponents) {
jsonObj.genericComponents = oldJsonObj.genericComponents
}
if (oldJsonObj.usingGlobalComponents) { // 复制 global components(针对不支持全局 usingComponents 的平台) if (oldJsonObj.usingGlobalComponents) { // 复制 global components(针对不支持全局 usingComponents 的平台)
jsonObj.usingGlobalComponents = oldJsonObj.usingGlobalComponents jsonObj.usingGlobalComponents = oldJsonObj.usingGlobalComponents
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册