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

fix: #7766
  • Loading branch information
LinusBorg committed Feb 23, 2023
1 parent 98f1934 commit 45a01f1
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 45a01f1

Please sign in to comment.