Skip to content

Commit c7bd2cc

Browse files
chore(demo): 修复v2 editor报错
1 parent 22027a4 commit c7bd2cc

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

packages/demo/demo-v2/src/pages/index/index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
<script>
2424
require.config({ paths: { 'vs': '//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/' }});
2525

26-
// try {
27-
// // https://github.com/microsoft/monaco-editor/blob/master/docs/integrate-amd-cross.md
28-
// window.MonacoEnvironment = {
29-
// getWorkerUrl: function(workerId, label) {
30-
// const code = encodeURIComponent(`
31-
// self.MonacoEnvironment = {
32-
// baseUrl: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/'
33-
// };
34-
// importScripts('https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/base/worker/workerMain.js');
35-
// `);
36-
//
37-
// return 'data:text/javascript;charset=utf-8,' + code;
38-
// }
39-
// };
40-
// } catch (e) {
41-
// // nothing ....
42-
// }
26+
try {
27+
// https://github.com/microsoft/monaco-editor/blob/master/docs/integrate-amd-cross.md
28+
window.MonacoEnvironment = {
29+
getWorkerUrl: function(workerId, label) {
30+
const code = encodeURIComponent(`
31+
self.MonacoEnvironment = {
32+
baseUrl: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/'
33+
};
34+
importScripts('https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/base/worker/workerMain.js');
35+
`);
36+
37+
return 'data:text/javascript;charset=utf-8,' + code;
38+
}
39+
};
40+
} catch (e) {
41+
// nothing ....
42+
}
4343
</script>
4444
</body>
4545
</html>

0 commit comments

Comments
 (0)