-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# setup执行的步骤 | ||
```ts | ||
// packages/runtime-core/src/components.ts | ||
function setupStatefulComponent( | ||
instance: ComponentInternalInstance, | ||
isSSR: boolean | ||
) { | ||
// 0. create render proxy property access cache | ||
// 创建渲染代理属性连接缓存 | ||
|
||
|
||
// 1. create public instance / render proxy | ||
// also mark it raw so it's never observed | ||
|
||
// 创建公共实例或渲染代理 | ||
// 也标记它原生,未被代理过 | ||
instance.proxy = markRaw() | ||
|
||
|
||
// 2. call setup() | ||
const setupResult = setup(); | ||
// 2.1. return the promise so server-renderer can wait on it | ||
|
||
// async setup returned Promise. | ||
// bail here and wait for re-entry. | ||
}; | ||
``` | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.