forked from mystiq/hydrogen-web
subViews is in TemplateView
This commit is contained in:
parent
c4b17e4be6
commit
0623c1c665
1 changed files with 3 additions and 2 deletions
|
@ -281,9 +281,10 @@ class TemplateBuilder {
|
||||||
const boolFn = value => !!fn(value);
|
const boolFn = value => !!fn(value);
|
||||||
return this._addReplaceNodeBinding(boolFn, (prevNode) => {
|
return this._addReplaceNodeBinding(boolFn, (prevNode) => {
|
||||||
if (prevNode && prevNode.nodeType !== Node.COMMENT_NODE) {
|
if (prevNode && prevNode.nodeType !== Node.COMMENT_NODE) {
|
||||||
const viewIdx = this._subViews.findIndex(v => v.root() === prevNode);
|
const subViews = this._templateView._subViews;
|
||||||
|
const viewIdx = subViews.findIndex(v => v.root() === prevNode);
|
||||||
if (viewIdx !== -1) {
|
if (viewIdx !== -1) {
|
||||||
const [view] = this._subViews.splice(viewIdx, 1);
|
const [view] = subViews.splice(viewIdx, 1);
|
||||||
view.unmount();
|
view.unmount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue