blockml component
1.0.0
BlockMLの仮想DOMを備えたコンポーネントベースのシステム(HTMLを作成する単純な言語)。それは反応と角度に似ていますが、可能な限り単純であることを意図しています。
使用例:
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"
}
}
}
}
`);