From 440f510d684d55885f904eacf6c0f5a3d1aa2cc2 Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Tue, 10 Apr 2018 14:12:47 +0800 Subject: [PATCH] opti: docs --- .npmignore | 1 - README.md | 26 +++++++++++++++++--------- package.json | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.npmignore b/.npmignore index 069f3a5..cd3b116 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,3 @@ node_modules/ -package/ src/ prd/ diff --git a/README.md b/README.md index 43adb73..49fbe2c 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,28 @@ npm install json-schema-editor-visual ``` ```js +const option = {} import 'antd/dist/antd.css' -const Schema = require("json-schema-editor-visual")(); - +require('json-schema-editor-visual/dist/main.css') +const schemaEditor = require("json-schema-editor-visual/dist/main.js"); +const SchemaEditor = schemaEditor(option) render( - , + , document.getElementById('root') ) ``` -## Run dev -``` -git clone https://github.com/YMFE/json-schema-editor-visual.git -npm install -npm run start -``` +## Option Object + +| name | desc | default | +| ---- | ----------- | --------- | +| `lg` | language, support `en_US` or `zh_CN` | en_US + +## SchemaEditor Props +| name | type | default | desc +| ---- | ----------- | --------- | --------- | +| `data` | string | null | the data of editor +| `onChange`| function | null | +| `showEditor` | boolean | false | diff --git a/package.json b/package.json index 97a5e6e..20d9cd7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "json-schema-editor-visual", "version": "1.0.8", "description": "jsonschema editor", - "main": "dist/main.js", + "main": "package/index.js", "license": "MIC", "scripts":{ "start": "ykit s -p 8082",