forked from Gitlink/forgeplus-react
文件显示/编辑内容不同
This commit is contained in:
parent
377ebf2c53
commit
b90f26d038
|
|
@ -25,7 +25,7 @@ if (isDev) {
|
|||
}
|
||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
|
||||
}
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
|
|
|
|||
|
|
@ -395,6 +395,7 @@ class CoderRootFileDetail extends Component {
|
|||
filepath={`/${detail.path}`}
|
||||
content={detail.content}
|
||||
readOnly={readOnly}
|
||||
md={md}
|
||||
editorType="update"
|
||||
currentBranch={currentBranch}
|
||||
descName={detail && `Update ${detail.name}`}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import 'codemirror/mode/clike/clike';
|
|||
import 'codemirror/mode/css/css';
|
||||
import UserSubmitComponent from "./UserSubmitComponent";
|
||||
import CloudIDE from "./cloudIDE";
|
||||
import { Base64 } from "js-base64";
|
||||
|
||||
import "./index.css";
|
||||
import "./editor.css";
|
||||
|
|
@ -34,7 +35,7 @@ class m_editor extends Component {
|
|||
|
||||
render() {
|
||||
const { editorValue, changeValue } = this.state;
|
||||
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath,ideTheme } = this.props;
|
||||
const { readOnly, editorType,onEmpty,filename,empty, currentBranch, descName, checkName, detail, match: { params },filepath, ideTheme , md } = this.props;
|
||||
const editor_options = {
|
||||
lineNumbers: "on",
|
||||
lineWrapping: true, //强制换行
|
||||
|
|
@ -64,7 +65,7 @@ class m_editor extends Component {
|
|||
{!readOnly ?
|
||||
<CodeMirror
|
||||
placeholder="请输入内容"
|
||||
value={editorValue}
|
||||
value={md ? editorValue : Base64.decode(editorValue)}
|
||||
options={editor_options}
|
||||
onChange={this.changeEditor}
|
||||
/> :
|
||||
|
|
|
|||
Loading…
Reference in New Issue