fix(compiler-ssr/teleport): correct the target prop of teleport (#2053)

This commit is contained in:
HcySunYang
2020-09-15 21:59:36 +08:00
committed by GitHub
parent cdd849a09c
commit 7455dca11c
3 changed files with 6 additions and 8 deletions

View File

@@ -26,6 +26,6 @@ export const enum SSRErrorCodes {
export const SSRErrorMessages: { [code: number]: string } = {
[SSRErrorCodes.X_SSR_CUSTOM_DIRECTIVE_NO_TRANSFORM]: `Custom directive is missing corresponding SSR transform and will be ignored.`,
[SSRErrorCodes.X_SSR_UNSAFE_ATTR_NAME]: `Unsafe attribute name for SSR.`,
[SSRErrorCodes.X_SSR_NO_TELEPORT_TARGET]: `No target prop on teleport element.`,
[SSRErrorCodes.X_SSR_NO_TELEPORT_TARGET]: `Missing the 'to' prop on teleport element.`,
[SSRErrorCodes.X_SSR_INVALID_AST_NODE]: `Invalid AST node during SSR transform.`
}

View File

@@ -19,7 +19,7 @@ export function ssrProcessTeleport(
node: ComponentNode,
context: SSRTransformContext
) {
const targetProp = findProp(node, 'target')
const targetProp = findProp(node, 'to')
if (!targetProp) {
context.onError(
createSSRCompilerError(SSRErrorCodes.X_SSR_NO_TELEPORT_TARGET, node.loc)