Skip to content

Commit

Permalink
fix(hmr): don't remove __file key from component type
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed May 6, 2021
1 parent 293b41b commit 9db3cbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function reload(id: string, newComp: ComponentOptions | ClassComponent) {
newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp
extend(component, newComp)
for (const key in component) {
if (!(key in newComp)) {
if (key !== '__file' && !(key in newComp)) {
delete (component as any)[key]
}
}
Expand Down

0 comments on commit 9db3cbb

Please sign in to comment.