feat: template ref handling + ref unmount

This commit is contained in:
Evan You
2019-08-19 18:06:20 -04:00
parent 10a2cf47ea
commit 8f9afdff64
3 changed files with 91 additions and 26 deletions

View File

@@ -3,10 +3,11 @@ export function patchDOMProp(
key: string,
value: any,
prevChildren: any,
parentComponent: any,
unmountChildren: any
) {
if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) {
unmountChildren(prevChildren)
unmountChildren(prevChildren, parentComponent)
}
el[key] = value
}