Skip to content

Commit 27179f6

Browse files
committed
fix(vue-jsx-vapor): generate correct HMR
1 parent d2b49ad commit 27179f6

File tree

1 file changed

+5
-1
lines changed
  • packages/vue-jsx-vapor/src/core

1 file changed

+5
-1
lines changed

packages/vue-jsx-vapor/src/core/hmr.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ export function injectHMRAndSSR(
111111
`\n${local}.__hmrId = "${id}";` +
112112
`\n__VUE_HMR_RUNTIME__.createRecord("${id}", ${local});`
113113
callbackCode += `
114-
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}'].setup || mod['${exported}']);`
114+
if (typeof mod['${exported}'] === 'function') {
115+
__VUE_HMR_RUNTIME__.rerender(mod['${exported}'].__hmrId, mod['${exported}']);
116+
} else {
117+
__VUE_HMR_RUNTIME__.reload(mod['${exported}'].__hmrId, mod['${exported}']);
118+
};`
115119
}
116120

117121
code += `

0 commit comments

Comments
 (0)