Open LS-LILEI opened 3 years ago
You may want to try require
instead of import for the css files. I guess your paths are not correct. According to the sample demo, the paths to import should be
require('codemirror/lib/codemirror.css');
require('codemirror/theme/material.css');
require('codemirror/theme/neat.css');
require('codemirror/mode/xml/xml.js');
require('codemirror/mode/javascript/javascript.js');
This is the code from reactJs, but maybe try this path and see if it helps.
this is my code Importing styles has no effect ` // Import the code mirror component. import {Controlled as CodeMirror} from 'react-codemirror2';
// The following two imports is for the theme. import '../lib/libraries/extensions/python/codemirror.css'; import 'codemirror/theme/material.css';
// This import is for the language syntax highlighting. import 'codemirror/mode/python/python.js';
//...
render () { return ( <AssetPanel buttons={[{ title: '新增代码', img: surpriseIcon, onClick: this.handleAddPython }]} items={[]} selectedItemIndex={this.state.selectedSoundIndex}
`