-
Notifications
You must be signed in to change notification settings - Fork 1
tohtml
Kingcean edited this page Jul 20, 2020
·
4 revisions
You can use this to convert a JSON model to HTML view part.
Following is a sample.
import * as Hje from 'hje';
let ele = document.createElement("div");
document.body.appendChild(ele);
Hje.render(ele, {
attr: {
type: "circle",
},
style: {
"color": "#808080", "font-size": "14px"
},
on: {
click(ev) { console.log("ul click", ev); }
},
children: [
{
tagName: "ul",
children: ["ABCDEFG", "HIJKLMN", "OPQ RST", "UVW XYZ"]
.map(ele => ({ tag: "li", children: ele }))
}
]
});