Skip to content

Commit

Permalink
Merge pull request #296 from lljj-x/v2
Browse files Browse the repository at this point in the history
修复 playground v2 editor 报错
  • Loading branch information
lljj-x committed May 1, 2023
2 parents e04edf9 + c7bd2cc commit f466120
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions packages/demo/demo-v2/src/pages/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.10/vue.min.js"></script>
<script src="//lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-ui/2.13.1/index.js"></script>
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue-router/3.1.3/vue-router.min.js"></script>
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/loader.js"></script>
<script src="//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/loader.js"></script>
<script>
require.config({ paths: { 'vs': '//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/' }});
require.config({ paths: { 'vs': '//lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/' }});

// try {
// // https://github.com/microsoft/monaco-editor/blob/master/docs/integrate-amd-cross.md
// window.MonacoEnvironment = {
// getWorkerUrl: function(workerId, label) {
// const code = encodeURIComponent(`
// self.MonacoEnvironment = {
// baseUrl: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/'
// };
// importScripts('https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.20.0/min/vs/base/worker/workerMain.js');
// `);
//
// return 'data:text/javascript;charset=utf-8,' + code;
// }
// };
// } catch (e) {
// // nothing ....
// }
try {
// https://github.com/microsoft/monaco-editor/blob/master/docs/integrate-amd-cross.md
window.MonacoEnvironment = {
getWorkerUrl: function(workerId, label) {
const code = encodeURIComponent(`
self.MonacoEnvironment = {
baseUrl: 'https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/'
};
importScripts('https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/monaco-editor/0.30.0/min/vs/base/worker/workerMain.js');
`);

return 'data:text/javascript;charset=utf-8,' + code;
}
};
} catch (e) {
// nothing ....
}
</script>
</body>
</html>

0 comments on commit f466120

Please sign in to comment.