From bb18358d32abc969ec2492e69b25711a5aa0714f Mon Sep 17 00:00:00 2001 From: wibus-wee <1596355173@qq.com> Date: Thu, 15 Dec 2022 21:52:06 +0800 Subject: [PATCH] fix(jwc-runtime): diff function return a vnode --- packages/jwc-runtime/v-dom/diff.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/jwc-runtime/v-dom/diff.ts b/packages/jwc-runtime/v-dom/diff.ts index 0a46010..6cd9040 100644 --- a/packages/jwc-runtime/v-dom/diff.ts +++ b/packages/jwc-runtime/v-dom/diff.ts @@ -16,7 +16,8 @@ export class VNode { constructor( tagName: string, attributes: { [key: string]: any }, - children: VNode[]) { + children: VNode[] + ) { this.tagName = tagName; this.attributes = attributes; this.children = children; @@ -42,11 +43,10 @@ export class VNode { * @param oldVNode * @param newVNode */ -export function diff(oldVNode: VNode, newVNode: VNode): VNode { +export function diff(oldVNode: VNode, newVNode: VNode) { markNewVNode(newVNode); diffRecursive(oldVNode, newVNode); update(newVNode); - return newVNode; } /**