Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
钱招严 committed Mar 18, 2021
1 parent d984d93 commit d320275
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const vnode: VNode = {
transition: null,
el: null,
anchor: null,
// target Teleport 中使用
target: null,
targetAnchor: null,
staticCount: 0,
Expand Down
2 changes: 2 additions & 0 deletions packages/runtime-core/src/components/Teleport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ export const TeleportImpl = {
}
}

// tip: 禁用就渲染到当前模板位置
if (disabled) {
mount(container, mainAnchor)
} else if (target) {
// tip: 否则渲染到 to 的位置
mount(target, targetAnchor)
}
} else {
Expand Down

0 comments on commit d320275

Please sign in to comment.