html代码编辑器jason,GitHub - 2947721120/jsoneditor: json编辑器

JSON 编辑器

描述

JSON编辑器是一个基于网络的工具来查看、编辑和格式JSON。 这模式如树有各种编辑器,代码编辑器和一个纯文本 。

编辑可以作为你自己的Web应用程序的一个组成部分。图书馆可以为 CommonJS模块,加载和模块,或作为一个JavaScript文件。

支持的浏览器:Chrome,Firefox,Safari,Opera,Internet Explorer 9.

34a027c020ae682a57f3f0d13908248c.png

559e596851726be5886ae501298e7a12.png

功能特色

树编辑

编辑、添加、移动、删除、复制字段和值。

改变的值的类型。

排序数组和对象。

彩色编码。

搜索和突出树视图中的文本。

撤消和重做所有的行动。

代码编辑器

格式和紧凑的JSON。

彩色编码(由ACE)。

检查JSON(由ACE)。

文本编辑器

格式和紧凑的JSON。

Documentation

Install

with npm:

npm install jsoneditor

with bower:

bower install jsoneditor

download:

More

There is a directive available for using JSONEditor in Angular.js:

Use

// create the editor

var container = document.getElementById("jsoneditor");

var editor = new JSONEditor(container);

// set json

var json = {

"Array": [1, 2, 3],

"Boolean": true,

"Null": null,

"Number": 123,

"Object": {"a": "b", "c": "d"},

"String": "Hello World"

};

editor.set(json);

// get json

var json = editor.get();

Build

The code of the JSON Editor is located in the folder ./src. To build

jsoneditor:

Install dependencies:

npm install

Build JSON Editor:

npm run build

This will generate the files ./jsoneditor.js, ./jsoneditor.css, and

minified versions in the root of the project.

Custom builds

The source code of JSONEditor consists of CommonJS modules. JSONEditor can be bundled in a customized way using a module bundler like browserify or webpack. First, install all dependencies of jsoneditor:

npm install

To create a custom bundle of the source code using browserify:

browserify ./index.js -o ./jsoneditor.custom.js -s JSONEditor

The Ace editor, used in mode code, accounts for about 75% of the total

size of the library. To exclude the Ace editor from the bundle:

browserify ./index.js -o ./jsoneditor.custom.js -s JSONEditor -x brace -x brace/mode/json -x brace/ext/searchbox

To minify the generated bundle, use uglifyjs:

uglifyjs ./jsoneditor.custom.js -o ./jsoneditor.custom.min.js -m -c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值