From c38f963c4ba965a407531e70f5256638b494ee29 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 25 Feb 2022 16:55:50 +0800 Subject: [PATCH] fix(app): add insert action --- packages/uni-app-plus/src/service/framework/dom/Page.ts | 8 +++++--- packages/uni-app-plus/src/view/framework/dom/index.ts | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/uni-app-plus/src/service/framework/dom/Page.ts b/packages/uni-app-plus/src/service/framework/dom/Page.ts index 1888e11ad5..c58c7ae978 100644 --- a/packages/uni-app-plus/src/service/framework/dom/Page.ts +++ b/packages/uni-app-plus/src/service/framework/dom/Page.ts @@ -212,9 +212,11 @@ export default class UniPageNode extends UniNode implements IUniPageNode { createAction[5] = extras as UniNodeJSON } } else { - if (__DEV__) { - console.error(formatLog(`Insert`, action, 'not found createAction')) - } + // 部分手机上,create 和 insert 可能不在同一批次,被分批发送 + this.updateActions.push(action) + // if (__DEV__) { + // console.error(formatLog(`Insert`, action, 'not found createAction')) + // } } break } diff --git a/packages/uni-app-plus/src/view/framework/dom/index.ts b/packages/uni-app-plus/src/view/framework/dom/index.ts index 74c53e1fff..403c665739 100644 --- a/packages/uni-app-plus/src/view/framework/dom/index.ts +++ b/packages/uni-app-plus/src/view/framework/dom/index.ts @@ -14,6 +14,7 @@ import { formatLog, ACTION_TYPE_PAGE_SCROLL, ACTION_TYPE_ADD_WXS_EVENT, + ACTION_TYPE_INSERT, } from '@dcloudio/uni-shared' import { UniNodeJSONMinify } from 'packages/uni-shared/src/vdom/Node' import { ACTION_TYPE_DICT, DictAction, Dictionary } from '../../../constants' @@ -64,8 +65,8 @@ function onPageUpdateSync(actions: (PageAction | DictAction)[]) { action[4], decodeNodeJson(getDict, action[5] as UniNodeJSONMinify) ) - // case ACTION_TYPE_INSERT: - // return $(action[1]).insert(action[2], action[3]) + case ACTION_TYPE_INSERT: + return $(action[1]).insert(action[2], action[3]) case ACTION_TYPE_REMOVE: return $(action[1]).remove() case ACTION_TYPE_SET_ATTRIBUTE: -- GitLab