| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 1× 17× 17× 17× 17× 17× 17× 17× 17× 17× 20× 9× | import { avalon } from '../seed/core'
avalon.directive('html', {
update: function(vdom, value) {
this.beforeDispose()
this.innerRender = avalon.scan('<div class="ms-html-container">' + value + '</div>', this.vm, function() {
var oldRoot = this.root
Eif(vdom.children)
vdom.children.length = 0
vdom.children = oldRoot.children
this.root = vdom
Eif (vdom.dom)
avalon.clearHTML(vdom.dom)
})
},
beforeDispose: function() {
if (this.innerRender) {
this.innerRender.dispose()
}
},
delay: true
}) |