@@ -264,21 +264,23 @@ const BaseComponent: VueConstructor<IBaseComponent> = Vue.extend({
264264} ) ;
265265
266266function cleanWidgetNode ( node : Node ) {
267+ const removedNodes : Element [ ] = [ ] ;
267268 forEachChildNode ( node , ( childNode : Element ) => {
268269 const parent = childNode . parentNode ;
269270 const isExtension = childNode . hasAttribute && childNode . hasAttribute ( "isExtension" ) ;
270271 if ( ( childNode . nodeName === "#comment" || isExtension ) && parent ) {
272+ removedNodes . push ( childNode ) ;
271273 parent . removeChild ( childNode ) ;
272274 }
273275 } ) ;
276+
277+ return removedNodes ;
274278}
275279
276- function restoreNodes ( el : Element , nodes : Record < number , ChildNode > ) {
277- for ( const key in nodes ) {
278- if ( nodes . hasOwnProperty ( key ) ) {
279- el . appendChild ( nodes [ key ] ) ;
280- }
281- }
280+ function restoreNodes ( el : Element , nodes : Element [ ] ) {
281+ nodes . forEach ( ( node ) => {
282+ el . appendChild ( node ) ;
283+ } ) ;
282284}
283285
284286const DxComponent : VueConstructor = BaseComponent . extend ( {
@@ -301,8 +303,7 @@ const DxComponent: VueConstructor = BaseComponent.extend({
301303 } ,
302304
303305 mounted ( ) : void {
304- const nodes = { ...this . $el . childNodes } ;
305- cleanWidgetNode ( this . $el ) ;
306+ const nodes = cleanWidgetNode ( this . $el ) ;
306307
307308 this . $_createWidget ( this . $el ) ;
308309 this . $_instance . endUpdate ( ) ;
0 commit comments