fix(hmr): support hmr for static nodes

This commit is contained in:
Evan You
2020-04-30 14:38:13 -04:00
parent 9f8ed4a9b5
commit 386b093554
2 changed files with 19 additions and 2 deletions

View File

@@ -69,3 +69,12 @@ export const nodeOps: Omit<RendererOptions<Node, Element>, 'patchProp'> = {
return node
}
}
if (__DEV__) {
// __UNSAFE__
// Reason: innerHTML.
// same as `insertStaticContent`, but this is also dev only (for HMR).
nodeOps.setStaticContent = (el, content) => {
el.innerHTML = content
}
}