提交 848248b7 编写于 作者: Q qiang

fix(mp-baidu): usingSwanComponents merge to wxComponents (question/155281)

上级 723bc495
......@@ -39,9 +39,11 @@ const {
// 将开发者手动设置的 usingComponents 调整名称,方便与自动解析到的 usingComponents 做最后合并
function renameUsingComponents (jsonObj) {
if (jsonObj.usingComponents) {
jsonObj.customUsingComponents = jsonObj.usingComponents
if (jsonObj.usingComponents || jsonObj.usingSwanComponents) {
// 暂定 usingComponents 优先级高于 usingSwanComponents
jsonObj.customUsingComponents = Object.assign({}, jsonObj.usingSwanComponents, jsonObj.usingComponents)
delete jsonObj.usingComponents
delete jsonObj.usingSwanComponents
}
return jsonObj
}
......
......@@ -49,9 +49,11 @@ function deepCopy (name, value, json) {
const pagesJson2AppJson = {
globalStyle: function (name, value, json) {
json.window = parseStyle(value)
if (json.window.usingComponents) {
json.usingComponents = json.window.usingComponents
if (json.window.usingComponents || json.window.usingSwanComponents) {
// 暂定 usingComponents 优先级高于 usingSwanComponents
json.usingComponents = Object.assign({}, json.window.usingSwanComponents, json.window.usingComponents)
delete json.window.usingComponents
delete json.window.usingSwanComponents
} else {
json.usingComponents = {}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册