Skip to content

Commit f466120

Browse files
authored
Merge pull request #296 from lljj-x/v2
修复 playground v2 editor 报错
2 parents e04edf9 + c7bd2cc commit f466120

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,27 @@
1919
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.10/vue.min.js"></script>
2020
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.13.1/index.js"></script>
2121
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue-router/3.1.3/vue-router.min.js"></script>
22-
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/loader.js"></script>
22+
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/loader.js"></script>
2323
<script>
24-
require.config({ paths: { 'vs': '//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/' }});
24+
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)