From 45a01f1efa6632d9c6ab3e7b790b64b250a5bbf8 Mon Sep 17 00:00:00 2001 From: Thorsten Luenborg Date: Thu, 23 Feb 2023 10:47:09 +0100 Subject: [PATCH] fix(compat): ensure proper handling of render fuction from SFC using Vue.extend fix: #7766 --- packages/runtime-core/src/compat/component.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/runtime-core/src/compat/component.ts b/packages/runtime-core/src/compat/component.ts index b09d579a59a..7248b0ed700 100644 --- a/packages/runtime-core/src/compat/component.ts +++ b/packages/runtime-core/src/compat/component.ts @@ -18,6 +18,15 @@ export function convertLegacyComponent( // 2.x constructor if (isFunction(comp) && comp.cid) { + // #7766 + if (comp.render) { + // only necessary when compiled from SFC + comp.options.render = comp.render + } + // copy over internal properties set by the SFC compiler + comp.options.__file = comp.__file + comp.options.__hmrId = comp.__hmrId + comp.options.__scopeId = comp.__scopeId comp = comp.options }