From 65a4d6273c3eb911aace17e7c9e94292666e26e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=B6=85=E6=B6=9B?= <10857776+chaoling83@user.noreply.gitee.com> Date: Sun, 18 Feb 2024 08:39:03 +0000 Subject: [PATCH] !147 fix(no-vdom): modify env test * fix(no-vdom): modify env test * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * fix(no-vdom): optimize dom.ts file * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * fix(no-vdom): modify $$style * fix(no-vdom): modify test name * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * fix(no-vdom): modify event * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * fix(no-vdom): modify test code's name rule * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * fix(no-vdom): delete no-vnode module * fix(no-vdom): update render function * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * Merge branch 'reactive' of https://gitee.com/openInula/inula into reactive * Merge remote-tracking branch 'origin/reactive' into reactive * fix(no-vdom): add TS * fix(no-vdom): change js 2 ts --- packages/inula-novdom/src/dom.ts | 2 +- packages/inula-novdom/tests/env.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/inula-novdom/src/dom.ts b/packages/inula-novdom/src/dom.ts index 930b5d0e..41af470f 100644 --- a/packages/inula-novdom/src/dom.ts +++ b/packages/inula-novdom/src/dom.ts @@ -169,7 +169,7 @@ function cleanChildren(parent: Node, prevNodes: Node[], marker?: Node, replaceme const el = prevNodes[i]; if (node !== el) { const isParent = el.parentNode === parent; - if (!inserted && !i) { + if (!inserted && i === 0) { isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker); } else { isParent && (el as ChildNode).remove(); diff --git a/packages/inula-novdom/tests/env.test.tsx b/packages/inula-novdom/tests/env.test.tsx index c9f20e18..74e7ac15 100644 --- a/packages/inula-novdom/tests/env.test.tsx +++ b/packages/inula-novdom/tests/env.test.tsx @@ -212,7 +212,7 @@ describe('env', () => { } render(() => $$runComponent(App, {}), container); - expect(container.innerHTML).toBe('