1.0.7 • Published 7 years ago
club3 v1.0.7
Table of Contents
Component
Component
register
Parameters
namestring must be a unique dash separate string.SelfClass component life cycle class. (optional, defaultComponent)
Examples
c3.register('app-root', class extends c3.Component {
attached() {
console.log(this.name, 'attached to', this.host.parentNode)
}
})VComment
Extends VNode
Create a new virtual comment.
VNode
diff
Create a Vpatch with all differences between given node
Parameters
nextVNode node to diff aganst.patchVPatch VPatch to add changes to. (optional, defaultnew VPatch())
Returns any VPatch
applyPatch
Apply all changes to given DOM Element
Parameters
nodeHTMLElementcontextObject bind to all event (optional, default{})
Examples
const parser = new HTMLParser()
const patch = new VDocument().diff(parser.parseHTML(`
<div onclick="this.clickHandler(event)"></div>
`))
patch.applyPatch(document.body, {
clickHandler(event) {
// ...handle event
}
})