0.2.3 • Published 5 years ago

sditor v0.2.3

Weekly downloads
4
License
Apache License 2....
Repository
github
Last release
5 years ago

Sditor = S chema + E Ditor

sditor

Introduction

S chema + E Ditor = Sditor

Sditor is a graphical editing component of JSON Schema. It is a React component based on TypeScript, which has very few APIs and can be quickly assembled into any React project.

Installation

npm install sditor -S

How to use

import * as React from "react";
import { Editor, EditorModel } from "sditor";

export class App extends React.Component {
  
  //EditorModel instance
  editorModel: EditorModel;

  onEditorReady = (model:EditorModel)=> {
    //You can set the initial value here.
    model.schema = { ... };
    //Temporary EditorModel instance
    this.editorModel = model;
  }

  onSave = ()=> {
    //Get the current schema through editorModel
    const schema = this.editorModel.schema;
    console.log('schema', schema);
  }

  render () {
    return <div>
      <Editor onReady={this.onEditorReady} style={{height: 500}} />
      <button onClick={this.onSave}>Save</button>
    </div>;
  }
  
}

Contributing to Sditor

  • Dependent build tools need to be installed dawn
  • Fork this repo, and clone to the local
  • Start development services through dn dev
  • Improve or add new features, submitted through PR
0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.5

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago