fix(hmr): don't remove __file key from component type

This commit is contained in:
Guillaume Chau 2021-05-06 14:21:54 +02:00
parent 293b41ba3b
commit 9db3cbbfc1

View File

@ -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]
}
}