Skip to content

Commit c73847f

Browse files
authoredMay 31, 2024··
fix(compat): ensure proper handling of render fuction from SFC using Vue.extend (#7781)
close #7766
1 parent 36bd9b0 commit c73847f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

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

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ export function convertLegacyComponent(
1818

1919
// 2.x constructor
2020
if (isFunction(comp) && comp.cid) {
21+
// #7766
22+
if (comp.render) {
23+
// only necessary when compiled from SFC
24+
comp.options.render = comp.render
25+
}
26+
// copy over internal properties set by the SFC compiler
27+
comp.options.__file = comp.__file
28+
comp.options.__hmrId = comp.__hmrId
29+
comp.options.__scopeId = comp.__scopeId
2130
comp = comp.options
2231
}
2332

0 commit comments

Comments
 (0)
Please sign in to comment.