@aligov/monaco-diff-editor
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

DiffEditor

@aligov/monaco-diff-editor

intro component

API

参数名 说明 必填 类型 默认值 备注
original 原始值 false string
value 当前值 true string
language 语言 true string
options 配置 false object 同monaco的options

基础用法

import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import MonacoDiffEditor from '@aligov/monaco-diff-editor';

class App extends Component {
  constructor(props) {
    super(props)
    this.editor = React.createRef();
  }

  getValue = () => {
    console.log(this.editor.current.getValue())
  }
  
 
  render() {
     return (
      <div style={{height: 300}}>
      <button onClick={this.getValue}>获取当前值</button>
        <MonacoDiffEditor ref={this.editor} original="ww"/>
      </div>
    );
  }
}

ReactDOM.render((
  <App />
), mountNode);

Readme

Keywords

Package Sidebar

Install

npm i @aligov/monaco-diff-editor

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

11.3 MB

Total Files

97

Last publish

Collaborators

  • wanyi.css
  • jasoncapricorn
  • qingkaili
  • huguoxin
  • shenyu.wsy
  • liunian
  • tao1991123
  • itrip
  • xiazhiqiang
  • mo.zhou
  • guoliang.hgl
  • daip
  • baizhao