refactor: rename <portal> to <teleport>
BREAKING CHANGE: `<portal>` has been renamed to `<teleport>`.
`target` prop is also renmaed to `to`, so the new usage will be:
```html
<Teleport to="#modal-layer" :disabled="isMobile">
<div class="modal">
hello
</div>
</Teleport>
```
The primary reason for the renaming is to avoid potential naming
conflict with [native portals](https://wicg.github.io/portals/).
This commit is contained in:
@@ -27,7 +27,7 @@ import {
|
||||
FRAGMENT,
|
||||
CREATE_COMMENT,
|
||||
OPEN_BLOCK,
|
||||
PORTAL
|
||||
TELEPORT
|
||||
} from '../runtimeHelpers'
|
||||
import { injectProp } from '../utils'
|
||||
import { PatchFlags, PatchFlagNames } from '@vue/shared'
|
||||
@@ -218,8 +218,8 @@ function createChildrenCodegenNode(
|
||||
// component vnodes are always tracked and its children are
|
||||
// compiled into slots so no need to make it a block
|
||||
((firstChild as ElementNode).tagType !== ElementTypes.COMPONENT ||
|
||||
// portal has component type but isn't always tracked
|
||||
vnodeCall.tag === PORTAL)
|
||||
// teleport has component type but isn't always tracked
|
||||
vnodeCall.tag === TELEPORT)
|
||||
) {
|
||||
vnodeCall.isBlock = true
|
||||
helper(OPEN_BLOCK)
|
||||
|
||||
Reference in New Issue
Block a user