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"
}
}
}
}
`);