blockml component
1.0.0
نظام قائم على المكون مع DOM افتراضية لـ blockml (لغة بسيطة تنشئ 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"
}
}
}
}
`);