Match-id-a4195774976a6bab660ca01ecef0e20e8c93baf6
This commit is contained in:
parent
290f2097c5
commit
3f08ed229f
|
@ -74,7 +74,7 @@ export class VNode {
|
||||||
suspenseDidCapture: boolean = false; // suspense是否捕获了异常
|
suspenseDidCapture: boolean = false; // suspense是否捕获了异常
|
||||||
promiseResolve: boolean = false; // suspense的promise是否resolve
|
promiseResolve: boolean = false; // suspense的promise是否resolve
|
||||||
|
|
||||||
path: Array<number> = []; // 保存从根到本节点的路径
|
path: string = ''; // 保存从根到本节点的路径
|
||||||
toUpdateNodes: Set<VNode> | null = null; // 保存要更新的节点
|
toUpdateNodes: Set<VNode> | null = null; // 保存要更新的节点
|
||||||
|
|
||||||
belongClassVNode: VNode | null = null; // 记录JSXElement所属class vNode,处理ref的时候使用
|
belongClassVNode: VNode | null = null; // 记录JSXElement所属class vNode,处理ref的时候使用
|
||||||
|
|
|
@ -143,7 +143,7 @@ export function createUndeterminedVNode(type, key, props) {
|
||||||
|
|
||||||
export function createTreeRootVNode(container) {
|
export function createTreeRootVNode(container) {
|
||||||
const vNode = newVirtualNode(TreeRoot, null, null, container);
|
const vNode = newVirtualNode(TreeRoot, null, null, container);
|
||||||
vNode.path.push(0);
|
vNode.path += 0;
|
||||||
createUpdateArray(vNode);
|
createUpdateArray(vNode);
|
||||||
return vNode;
|
return vNode;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ export function createVNode(tag: VNodeTag | string, ...secondArg) {
|
||||||
case TreeRoot:
|
case TreeRoot:
|
||||||
// 创建treeRoot
|
// 创建treeRoot
|
||||||
vNode = newVirtualNode(TreeRoot, null, null, secondArg[0]);
|
vNode = newVirtualNode(TreeRoot, null, null, secondArg[0]);
|
||||||
vNode.path.push(0);
|
vNode.path += 0;
|
||||||
|
|
||||||
createUpdateArray(vNode);
|
createUpdateArray(vNode);
|
||||||
break;
|
break;
|
||||||
|
@ -165,7 +165,7 @@ export function createVNode(tag: VNodeTag | string, ...secondArg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateVNodePath(vNode: VNode) {
|
export function updateVNodePath(vNode: VNode) {
|
||||||
vNode.path = [...vNode.parent.path, vNode.cIndex];
|
vNode.path = vNode.parent.path + vNode.cIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createVNodeFromElement(element: JSXElement): VNode {
|
export function createVNodeFromElement(element: JSXElement): VNode {
|
||||||
|
|
Loading…
Reference in New Issue