json-schema 的编辑器

最近在找一个 json-schema 的编辑器,在网上找了找,以下两个项目用的比较多

一、两款json-schema-editor

1、vue-json-schema-editor-visual

一个高效易用的基于 Vue + Element UI 的 json-schema 编辑器。

git地址:https://github.com/giscafer/vue-json-schema-editor-visual

demo地址:http://blog.giscafer.com/sinokit/#/./components/jsonschema-editor

demo截图:

2、json-schema-editor-vue

相似项目,支持vue2 和vue 3

git地址:https://github.com/zyqwst/json-schema-editor-vue

demo地址:http://json-schema.sviip.com/

demo截图:

二、运行 json-schema-editor

1、vue-json-schema-editor-visual从git上下载代码

  1. 解压后进入 examples 目录

  2. 执行 npm install 安装依赖库

  3. 执行 npm run serve

  4. 浏览器访问 http://localhost:8081/

2、json-schema-editor-vue

  1. 从git上下载代码
  2. 解压后进入 examples 目录
  3. 执行 npm install 安装依赖库
  4. 执行 npm run serve
  5. 浏览器访问 http://localhost:8081

三、修改 vue-json-schema-editor-visual 源码重新编译

我想要的 json-schema 编辑器,需要有默认值,所以选用了 vue-json-schema-editor-visual 但这个组件又多了一个编辑按钮,没办法只能修改源码把它去掉了。

1、在源码中找到所有 class="el-icon-edit" 按钮,并将其注释。

2、从 examples 目录中退出来,运行 npm run build 重新编译。由于我是mac m1芯片电脑编译报错,如下图

3、没办法只能把代码复制到linux服务器上重新编译。编译成功后你就会在 dist 目录中得到一个 json-schema-editor.min.js 文件。

4、把这个文件复制到你自己的项目中,将原来的

复制代码
import` `JsonSchemaEditor from ``'vue-json-schema-editor-visual'

改为本地文件

复制代码
import` `JsonSchemaEditor from ``'./directive/vue-json-schema-editor-visual/json-schema-editor.min.js'

5、这样就可以了,但有一个问题由于引用了一个 js ,运行项目时会抛一堆警告

参考

https://blog.csdn.net/jiangjunsss/article/details/134120182

相关推荐
wefly20171 小时前
免安装!m3u8live.cn在线 M3U8 播放器,小白也能快速上手
java·开发语言·python·json·php·m3u8·m3u8在线转换
FateRing2 小时前
vscode插件fail to fecth
ide·vscode·编辑器
xiaoliuliu123455 小时前
HBuilderX 4.2 前端开发工具安装教程:详细步骤+自定义安装路径
编辑器·sublime text
_长银9 小时前
Sublime Text保持只打开一个
编辑器·sublime text
-许平安-10 小时前
MCP项目笔记七(插件 calculator)
c++·笔记·json·plugin·mcp
螺丝钉code14 小时前
迁移到 Openrouter 后 Claude Code Vscode 插件出现了一些奇怪的问题
ide·vscode·编辑器
ID_1800790547315 小时前
淘宝商品详情API的调用频率限制是多少?
大数据·数据库·json
wefly201716 小时前
jsontop.cn:一站式 JSON 全能工具集,开发全流程效率神器
前端·javascript·python·django·json·json在线转换
电商API&Tina1 天前
比价 / 选品专用:京东 + 淘宝 核心接口实战(可直接复制运行)
大数据·数据库·人工智能·python·json·音视频
薛定猫AI1 天前
【一键配置】优雅使用Claude Code:从安装到上手的完整教程
人工智能·arcgis·编辑器·vim