fix(compat): ensure proper handling of render fuction from SFC using Vue.extend (#7781)

close #7766
This commit is contained in:
Thorsten Lünborg 2024-05-31 17:49:18 +02:00 committed by GitHub
parent 36bd9b0a1f
commit c73847f2be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View 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
}