blockml component
1.0.0
Ein komponentbasiertes System mit einem virtuellen DOM für BlockML (eine einfache Sprache, die HTML erstellt). Es ist ähnlich wie Reakt und Winkel, aber so einfach wie möglich.
Beispiel Verwendung:
var blockml = require('blockml');
blockml.component = require('blockml-component');
blockml.component('Page', {
render: function (props, children) {
return blockml`
div {
${children}
}
`;
}
});
// a custom "App" component that we can use in our code
blockml.component('App', {
render: function (props, children) {
return blockml`
Page {
h1 {
"Hello World"
}
${children}
}
`;
}
});
// this will hold the rendered html
var html = blockml.render(`
html {
head;
body {
App {
h1 {
"Hello"
}
}
}
}
`);