【发布时间】:2018-12-18 07:44:09
【问题描述】:
我可以在 AngularJS 中实现 monaco-editor,但是如果用户通过“未定义摩纳哥”的错误刷新页面 monaco,这是因为 monaco 正在加载延迟。有没有其他方式可以立即加载 monaco .这是代码..
resolve: {
srcipts: function (lazyScript) {
return lazyScript.register([
"monaco-editor/min/vs/loader.js",
"monaco-editor/min/vs/editor/editor.main.nls.js",
"monaco-editor/min/vs/editor/editor.main.js"
]).then(function () {
// console.log(require);
require.config({ paths: { 'vs': 'monaco-editor/min/vs' } })
// console.log(monaco)
})
}
}
这是我推荐的链接
https://github.com/Microsoft/monaco-editor/blob/master/docs/integrate-amd.md
https://microsoft.github.io/monaco-editor/playground.html
帮我解决这个问题
【问题讨论】: