react-codemirror-merge CodeMirror merge view for React. Install npm install react-codemirror-merge --save Usage importCodeMirrorMergefrom'react-codemirror-merge';import{EditorView}from'codemirror';import{EditorState}from'@codemirror/state';constOriginal=CodeMirrorMerge.Original;constModified=CodeMirrorMerge.Mod...
调用代码: const target = document.getElementById('viewCompare'); CodeMirror.mergeView(target, { value: this.state.data.branchCtx, origLeft: null, orig: this.state.data.trunkCtx, lineNumbers: true, mode: 'text/x-java', highlightDifferences: true, lineWrapping: true, readOnly: true, });...
upgradev4.23.1 importReact,{useState}from'react';importCodeMirrorMergefrom'react-codemirror-merge';constOriginal=CodeMirrorMerge.Original;constModified=CodeMirrorMerge.Modified;letdoc=`onetwothreefourfive`;exportdefaultfunctionApp(){const[value,setValue]=useState(doc);const[valueModified,setValueModified]=use...
v4.19.13 fix(react-codemirror-merge): fixrefissue. (#455)9f90348 435d5ca jaywcjloveadded a commit that referenced this issueApr 7, 2023 released v4.19.14 (#455) d7ca858 https://uiwjs.github.io/react-codemirror/#/merge/document ...
import CodeMirrorMerge, { CodeMirrorMergeProps } from 'react-codemirror-merge'; import { langs } from '@uiw/codemirror-extensions-langs'; import { originalCode, modifiedCode } from './code'; const Original = CodeMirrorMerge.Original; const Modified = CodeMirrorMerge.Modified; export const MergeEx...