提交 4ce481b4 编写于 作者: fxy060608's avatar fxy060608

fix(app): parentNodeId

上级 c38f963c
......@@ -58,10 +58,12 @@ function onPageUpdateSync(actions: (PageAction | DictAction)[]) {
case ACTION_TYPE_PAGE_CREATED:
return onPageCreated()
case ACTION_TYPE_CREATE:
const parentNodeId = action[3]
return createElement(
action[1],
getDict(action[2] as number),
action[3],
// 部分性能低的手机,createAction 与 insertAction 是分开的,导致根节点 parentNodeId 为 -1
parentNodeId === -1 ? 0 : parentNodeId,
action[4],
decodeNodeJson(getDict, action[5] as UniNodeJSONMinify)
)
......
......@@ -82,7 +82,13 @@ function setPageReady() {
console.log(formatLog('setPageReady', pageReadyCallbacks.length))
}
isPageReady = true
pageReadyCallbacks.forEach((fn) => fn())
pageReadyCallbacks.forEach((fn) => {
try {
fn()
} catch (e: unknown) {
console.error(e)
}
})
pageReadyCallbacks.length = 0
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册