]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compat): ensure proper handling of render fuction from SFC using Vue.extend ...
authorThorsten Lünborg <t.luenborg@googlemail.com>
Fri, 31 May 2024 15:49:18 +0000 (17:49 +0200)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 15:49:18 +0000 (23:49 +0800)
close #7766

packages/runtime-core/src/compat/component.ts

index 84a76eb73a134d60b961399e556a1df100521f28..da12e60c58b905ef7c652911d13e8826dfe80798 100644 (file)
@@ -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
   }