ice/packages/runtime/templates/js-entry.js.ejs

20 lines
481 B
Plaintext

<%- prependCode %>
(function () {
<%- createElement %>
<% if (head && head.children) {-%>
<%- JSON.stringify(head.children) %>.forEach(ele => {
__ICE__CREATE_ELEMENT(ele, document.head);
});
<% } -%>
<% if (body && body.children) {-%>
<%- JSON.stringify(body.children) %>.forEach(ele => {
__ICE__CREATE_ELEMENT(ele, document.body);
});
<% } -%>
})();
<% if (extraScript) {-%>
<% extraScript.forEach((script, index) => { -%>
<%- script %>
<% }) -%>
<% } -%>