File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -81,18 +81,22 @@ export function interceptInit(callback) { initInterceptors.push(callback) }
81
81
export function initTree ( el , walker = walk , intercept = ( ) => { } ) {
82
82
deferHandlingDirectives ( ( ) => {
83
83
walker ( el , ( el , skip ) => {
84
- if ( ! el . _x_isInit ) {
85
- intercept ( el , skip )
84
+ // Prevent initing an element multiple times...
85
+ if ( el . _x_inited ) {
86
+ el . _x_ignore && skip ( )
86
87
87
- initInterceptors . forEach ( i => i ( el , skip ) )
88
- directives ( el , el . attributes ) . forEach ( handle => handle ( ) )
88
+ return
89
89
}
90
90
91
- if ( el . _x_ignore ) {
92
- skip ( )
93
- } else {
94
- el . _x_isInit = true
95
- }
91
+ intercept ( el , skip )
92
+
93
+ initInterceptors . forEach ( i => i ( el , skip ) )
94
+
95
+ directives ( el , el . attributes ) . forEach ( handle => handle ( ) )
96
+
97
+ el . _x_ignore && skip ( )
98
+
99
+ el . _x_inited = true
96
100
} )
97
101
} )
98
102
}
@@ -101,6 +105,7 @@ export function destroyTree(root) {
101
105
walk ( root , el => {
102
106
cleanupAttributes ( el )
103
107
cleanupElement ( el )
108
+
104
109
delete el . _x_isInit
105
110
} )
106
111
}
You can’t perform that action at this time.
0 commit comments