This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
bytedo
/
anot
Archived
1
0
Fork 0
anot/src/vdom/VText.js

20 lines
382 B
JavaScript

import { Anot, _decode } from '../seed/core'
export function VText(text) {
this.nodeName = '#text'
this.nodeValue = text
}
VText.prototype = {
constructor: VText,
toDOM() {
/* istanbul ignore if*/
if (this.dom) return this.dom
var v = _decode(this.nodeValue)
return (this.dom = document.createTextNode(v))
},
toHTML() {
return this.nodeValue
}
}
前端迷你mvvm框架。基于司徒正美的`avalon2.x`版精简修改而来。
JavaScript 100%