|
|
@ -16,7 +16,9 @@ function post(_: any, vnode: VNode): void {
|
|
|
|
|
|
|
|
|
|
|
|
function destroy(vnode: VNode): void {
|
|
|
|
function destroy(vnode: VNode): void {
|
|
|
|
// Remove placeholder
|
|
|
|
// Remove placeholder
|
|
|
|
vnode.elm && vnode.elm.parentElement.removeChild(vnode.elm);
|
|
|
|
if (vnode.elm !== undefined) {
|
|
|
|
|
|
|
|
(vnode.elm.parentElement as HTMLElement).removeChild(vnode.elm);
|
|
|
|
|
|
|
|
}
|
|
|
|
// Remove real element from where it was inserted
|
|
|
|
// Remove real element from where it was inserted
|
|
|
|
vnode.elm = (vnode.data as VNodeData).attachData.real;
|
|
|
|
vnode.elm = (vnode.data as VNodeData).attachData.real;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -44,4 +46,4 @@ export function attachTo(target: Element, vnode: VNode): VNode {
|
|
|
|
hook.destroy = destroy;
|
|
|
|
hook.destroy = destroy;
|
|
|
|
return vnode;
|
|
|
|
return vnode;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default attachTo;
|
|
|
|
export default attachTo;
|
|
|
|