|
@@ -82,16 +82,17 @@ export function interceptInit(callback) { initInterceptors.push(callback) }
|
|
|
export function initTree(el, walker = walk, intercept = () => {}) {
|
|
|
deferHandlingDirectives(() => {
|
|
|
walker(el, (el, skip) => {
|
|
|
- intercept(el, skip)
|
|
|
+ if (!el._x_isInit) {
|
|
|
+ intercept(el, skip)
|
|
|
|
|
|
- initInterceptors.forEach(i => i(el, skip))
|
|
|
-
|
|
|
- directives(el, el.attributes).forEach(handle => handle())
|
|
|
+ initInterceptors.forEach(i => i(el, skip))
|
|
|
+ directives(el, el.attributes).forEach(handle => handle())
|
|
|
+ }
|
|
|
|
|
|
if (el._x_ignore) {
|
|
|
- skip()
|
|
|
+ skip()
|
|
|
} else {
|
|
|
- el._x_isInit = true
|
|
|
+ el._x_isInit = true
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -101,5 +102,6 @@ export function destroyTree(root) {
|
|
|
walk(root, el => {
|
|
|
cleanupAttributes(el)
|
|
|
cleanupElement(el)
|
|
|
+ delete el._x_isInit
|
|
|
})
|
|
|
}
|