createWebWorker
语法:
createWebWorker<T>(opts): MonacoWebWorker<T>
泛型:
T extends object
参数:
opts
: IWebWorkerOptions返回值:MonacoWebWorker
<T>
描述:创建一个新的 Web Worker 实例
示例:
js
const worker = editor.createWebWorker({
moduleId: "myWorker",
label: "My Worker",
createData: {
languageId: "javascript",
},
});
console.log(worker);
- 输出