Skip to content

Commit

Permalink
fix(compat): ensure proper handling of render fuction from SFC using …
Browse files Browse the repository at this point in the history
…Vue.extend (#7781)

close #7766
  • Loading branch information
LinusBorg authored May 31, 2024
1 parent 36bd9b0 commit c73847f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/runtime-core/src/compat/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit c73847f

Please sign in to comment.