mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-26 16:20:09 +02:00
load monaco dependencies asyncly
This commit is contained in:
12
src/utils.js
12
src/utils.js
@@ -305,6 +305,18 @@ export function loadJS(src) {
|
||||
return d.promise;
|
||||
}
|
||||
|
||||
export function loadCss(src) {
|
||||
var d = deferred();
|
||||
var style = window.document.createElement('link');
|
||||
style.setAttribute('href', src);
|
||||
style.setAttribute('rel', 'stylesheet');
|
||||
document.head.appendChild(style);
|
||||
style.onload = function() {
|
||||
d.resolve();
|
||||
};
|
||||
return d.promise;
|
||||
}
|
||||
|
||||
/* eslint-disable max-params */
|
||||
export function getCompleteHtml(html, css, js, item, isForExport) {
|
||||
/* eslint-enable max-params */
|
||||
|
Reference in New Issue
Block a user