提交 7693553c 编写于 作者: fxy060608's avatar fxy060608

fix(mp-alipay): merge usingGlobalComponents #827

上级 69dd2179
......@@ -71,7 +71,11 @@ function updateComponentJson (name, jsonObj, usingComponents = true) {
const oldJsonStr = getJsonFile(name)
if (oldJsonStr) { // update
if (usingComponents) { // merge usingComponents
jsonObj.usingComponents = JSON.parse(oldJsonStr).usingComponents || {}
const oldJsonObj = JSON.parse(oldJsonStr)
jsonObj.usingComponents = oldJsonObj.usingComponents || {}
if (oldJsonObj.usingGlobalComponents) { // 复制 global components(针对不支持全局 usingComponents 的平台)
jsonObj.usingGlobalComponents = oldJsonObj.usingGlobalComponents
}
}
const newJsonStr = JSON.stringify(jsonObj, null, 2)
if (newJsonStr !== oldJsonStr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册