VanJS (abbr. Vanilla JavaScript) is an ultra-lightweight, zero-dependency and unopinionated Reactive UI framework based on pure vanilla JavaScript and DOM. Programming with VanJS feels a lot like React
import van from "./van.js"
const {span, button} = van.tags
const Counter = () => {
const counter = van.state(0)
return span(
"❤️ ", counter, " ",
button({onclick: () => ++counter.val}, "👍"),
button({onclick: () => --counter.val}, "👎"),
)
}
van.add(document.getElementById("app"), Counter())
Top comments (4)
With some very small additions we can enable a simplified composition style in VanJS, which does not restrict any other options or styles. Included in VanJS this should give only very little additional code...
This is the working example
Thank you Eckehard :-)
There are different ways to add the "DML-Style" to VanJS, but the most convenient would be an extension of the VanJS-core. I made a pull-request to add this feature. Please check out!
Hy Eckehard,
For me that would be a very great addition :-),
You have reached what I have wanted to do with MVU :-)
Hope Tao will find this nice too :-)