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:
@@ -11,7 +11,7 @@ import {
|
||||
buildSlots,
|
||||
FunctionExpression,
|
||||
TemplateChildNode,
|
||||
PORTAL,
|
||||
TELEPORT,
|
||||
createIfStatement,
|
||||
createSimpleExpression,
|
||||
getBaseTransformPreset,
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
processChildren,
|
||||
processChildrenAsStatement
|
||||
} from '../ssrCodegenTransform'
|
||||
import { ssrProcessPortal } from './ssrTransformPortal'
|
||||
import { ssrProcessTeleport } from './ssrTransformTeleport'
|
||||
import {
|
||||
ssrProcessSuspense,
|
||||
ssrTransformSuspense
|
||||
@@ -146,8 +146,8 @@ export function ssrProcessComponent(
|
||||
if (!node.ssrCodegenNode) {
|
||||
// this is a built-in component that fell-through.
|
||||
const component = componentTypeMap.get(node)!
|
||||
if (component === PORTAL) {
|
||||
return ssrProcessPortal(node, context)
|
||||
if (component === TELEPORT) {
|
||||
return ssrProcessTeleport(node, context)
|
||||
} else if (component === SUSPENSE) {
|
||||
return ssrProcessSuspense(node, context)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user