提交 29370eb8 编写于 作者: fxy060608's avatar fxy060608

fix(mp): remove invalid property

上级 c276f6c6
...@@ -13,13 +13,14 @@ const { ...@@ -13,13 +13,14 @@ const {
} = require('@dcloudio/uni-cli-shared/lib/cache') } = require('@dcloudio/uni-cli-shared/lib/cache')
const { const {
darkmode, darkmode,
hasTheme hasTheme
} = require('@dcloudio/uni-cli-shared/lib/theme') } = require('@dcloudio/uni-cli-shared/lib/theme')
const { const {
hasOwn, hasOwn,
parseStyle parseStyle,
trimMPJson
} = require('../util') } = require('../util')
function defaultCopy (name, value, json) { function defaultCopy (name, value, json) {
...@@ -171,12 +172,6 @@ function getCondition (pagesJson) { ...@@ -171,12 +172,6 @@ function getCondition (pagesJson) {
} }
return false return false
} }
function trimAppJson (app) {
delete app.topWindow
delete app.leftWindow
delete app.rightWindow
}
module.exports = function (pagesJson, manifestJson, project = {}) { module.exports = function (pagesJson, manifestJson, project = {}) {
const app = { const app = {
...@@ -251,14 +246,14 @@ module.exports = function (pagesJson, manifestJson, project = {}) { ...@@ -251,14 +246,14 @@ module.exports = function (pagesJson, manifestJson, project = {}) {
return { return {
app: { app: {
name: 'app', name: 'app',
content: trimAppJson(app) content: trimMPJson(app)
} }
} }
} }
return { return {
app: { app: {
name: 'app', name: 'app',
content: trimAppJson(app) content: trimMPJson(app)
}, },
project: { project: {
name: 'project.config', name: 'project.config',
...@@ -317,7 +312,7 @@ module.exports = function (pagesJson, manifestJson, project = {}) { ...@@ -317,7 +312,7 @@ module.exports = function (pagesJson, manifestJson, project = {}) {
return { return {
app: { app: {
name: 'app', name: 'app',
content: trimAppJson(app) content: trimMPJson(app)
}, },
project: { project: {
name: 'project.config', name: 'project.config',
......
...@@ -41,9 +41,16 @@ function hasOwn (obj, key) { ...@@ -41,9 +41,16 @@ function hasOwn (obj, key) {
return _hasOwnProperty.call(obj, key) return _hasOwnProperty.call(obj, key)
} }
function trimMPJson (json) {
delete json.topWindow
delete json.leftWindow
delete json.rightWindow
return json
}
function parseStyle (style = {}, root = '') { function parseStyle (style = {}, root = '') {
// TODO pages.json 触发了两次,需要排查 // TODO pages.json 触发了两次,需要排查
style = JSON.parse(JSON.stringify(style)) style = trimMPJson(JSON.parse(JSON.stringify(style)))
let platformStyle = {} let platformStyle = {}
...@@ -117,5 +124,6 @@ function parseTabBar (style = {}) { ...@@ -117,5 +124,6 @@ function parseTabBar (style = {}) {
module.exports = { module.exports = {
hasOwn, hasOwn,
parseStyle, parseStyle,
parseTabBar parseTabBar,
trimMPJson
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册