mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 15:42:39 +08:00
e3e1db619f
* Revert "move in port/native to platforms/native (#7962)"
This reverts commit 96871ba26b.
* move port/native into platforms/native
32 lines
689 B
JavaScript
32 lines
689 B
JavaScript
const HTMLElement = require('./HTMLElement');
|
|
const Event = require('./Event');
|
|
|
|
const _importmaps = [];
|
|
|
|
class HTMLScriptElement extends HTMLElement {
|
|
constructor(width, height) {
|
|
super('script');
|
|
}
|
|
|
|
set type (type) {
|
|
if (type === "systemjs-importmap") {
|
|
if (_importmaps.indexOf(this) === -1) {
|
|
_importmaps.push(this);
|
|
}
|
|
}
|
|
}
|
|
|
|
set src(url) {
|
|
setTimeout(()=>{
|
|
require(url);
|
|
this.dispatchEvent(new Event('load'));
|
|
}, 0);
|
|
}
|
|
}
|
|
|
|
HTMLScriptElement._getAllScriptElementsSystemJSImportType = function () {
|
|
return _importmaps;
|
|
}
|
|
|
|
module.exports = HTMLScriptElement;
|