avalon2
Version:
an elegant efficient express mvvm framework
17 lines (16 loc) • 408 B
JavaScript
import { document } from '../seed/core'
export function VComment(text) {
this.nodeName = '#comment'
this.nodeValue = text
}
VComment.prototype = {
constructor: VComment,
toDOM: function() {
if (this.dom)
return this.dom
return this.dom = document.createComment(this.nodeValue)
},
toHTML: function() {
return '<!--' + this.nodeValue + '-->'
}
}