mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:28:37 +08:00
Merge pull request #833 from feizhen/editor-json-worker-fix
fix(components): 修复monaco-editor加载json worker报错问题
This commit is contained in:
commit
cc9fc91200
@ -16,7 +16,7 @@ function filterUrl(url: string) {
|
||||
}
|
||||
|
||||
(window as any).MonacoEnvironment = {
|
||||
getWorkerUrl: function(moduleId: string, label: string) {
|
||||
getWorkerUrl: function (moduleId: string, label: string) {
|
||||
let url = '/pkg/editor.worker.js';
|
||||
|
||||
if (label === 'json') {
|
||||
@ -202,7 +202,7 @@ export class Editor extends React.Component<EditorProps, any> {
|
||||
});
|
||||
|
||||
// json 默认开启验证。
|
||||
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
||||
monaco.languages.json?.jsonDefaults.setDiagnosticsOptions({
|
||||
enableSchemaRequest: true,
|
||||
validate: true,
|
||||
allowComments: true
|
||||
|
Loading…
Reference in New Issue
Block a user