Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-editor-vue

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-editor-vue

JSON editor & viewer for Vue 2 and 3 powered by svelte-jsoneditor & vue-json-viewer.

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
decreased by-0.45%
Maintainers
1
Weekly downloads
 
Created
Source

json-editor-vue

JSON editor & viewer for Vue 2 and 3 powered by svelte-jsoneditor & vue-json-viewer

svelte-jsoneditor是 jsoneditor 作者带来的全新JSON编辑器。 作者开这个新坑的原因是老库已难以维护、架构需要大改、体验亟待提升。json-editor-vue是svelte-jsoneditor的Vue版本。


Features

  • 同时支持Vue3 & Vue2
  • JSON编辑 + JSON预览
  • 双向绑定输入值
  • 自动修复格式错误的JSON字符串
  • 适配 element-plus & element-ui(禁用状态默认跟随 el-form
  • 全局或局部引入,参数支持全局或局部配置

Installation

NPM

Vue3

pnpm add json-editor-vue svelte-jsoneditor
// 全局引入

import JsonEditorVue from 'json-editor-vue'

createApp(App)
.use(JsonEditorVue, {
  // 全局配置
})
<!-- 局部引入 -->

<template>
  <JsonEditorVue v-model="value" v-bind="{/* 局部配置 */}"/>
</template>

<script setup>
import JsonEditorVue from 'json-editor-vue'
</script>

Vue2

pnpm add json-editor-vue svelte-jsoneditor @vue/composition-api
// 全局引入

import JsonEditorVue from 'json-editor-vue'

Vue.use(JsonEditorVue, {
  // 全局配置
})
<!-- 局部引入 -->

<template>
  <JsonEditorVue :modelValue.sync="value" v-bind="{/* 局部配置 */}"/>
</template>

<script>
import JsonEditorVue from 'json-editor-vue'

export default {
  components: { JsonEditorVue },
}
</script>

Props

AttributeDescriptionTypeAccepted ValuesDefault
v-model / modelValue绑定值any
readonly是否只读booleanfalse
readonlyOptionsprops of vue-json-viewerobject
...props of svelte-jsoneditor

Config rules

  • 双向绑定参数(v-model / modelValue)仅支持局部配置
  • 其余参数均支持全局或局部配置

权重:

  • 局部配置高于全局配置
  • 对于对象类型的参数,局部配置会与全局配置进行合并,同名属性会被局部配置覆盖

Keywords

FAQs

Package last updated on 11 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc