Merge "fix: fix the worker-json error in browser console"
This commit is contained in:
commit
a59125fc5b
@ -14,6 +14,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import AceEditor from 'react-ace';
|
||||
import ace from 'ace-builds';
|
||||
import 'ace-builds/src-noconflict/mode-json';
|
||||
// import 'ace-builds/src-noconflict/mode-yaml';
|
||||
// import 'ace-builds/src-noconflict/mode-groovy';
|
||||
@ -21,6 +22,11 @@ import 'ace-builds/src-noconflict/theme-github';
|
||||
|
||||
import './custom.less';
|
||||
|
||||
// eslint-disable-next-line import/no-webpack-loader-syntax,import/no-unresolved
|
||||
const worker = require('file-loader?esModule=false!ace-builds/src-noconflict/worker-json');
|
||||
|
||||
ace.config.setModuleUrl('ace/mode/json_worker', worker);
|
||||
|
||||
export default class AceEditorWrapper extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
|
@ -60,7 +60,11 @@ const getCodeValue = (value, mode) => {
|
||||
|
||||
class CodeEditor extends PureComponent {
|
||||
static propTypes = {
|
||||
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
||||
value: PropTypes.oneOfType([
|
||||
PropTypes.string,
|
||||
PropTypes.object,
|
||||
PropTypes.array,
|
||||
]),
|
||||
mode: PropTypes.string,
|
||||
options: PropTypes.object,
|
||||
onChange: PropTypes.func,
|
||||
|
Loading…
Reference in New Issue
Block a user