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

Optionated json editor & json viewer

  • 0.1.0
  • Source
  • npm
  • Socket score

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

json-editor-vue

Optionated json editor & json viewer powered by svelte-jsoneditor & vue-json-viewer


Features

  • √ json编辑 + json预览
  • √ v-model双绑
  • √ 适配 element-ui 的el-form组件 支持el-form的全局disabled
  • √ 全局或局部引入 参数支持全局或局部配置

Installation

NPM

Dependencies:vue

// 全局引入

import 'json-editor-vue/dist/style.css'
import JsonEditorVue from 'json-editor-vue'

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

<template>
  <JsonEditorVue v-bind="config"/>
</template>

<script>
import 'json-editor-vue/dist/style.css'
import JsonEditorVue from 'json-editor-vue'

export default {
  components: { JsonEditorVue },
  data () {
    return {
      config: {
        // 局部配置
      }
    }
  }
}
</script>

Props

AttributeDescriptionTypeAccepted ValuesDefault
value / v-model数据对象object / array / undefined / null /
readonly是否只读booleanfalse
vueJsonViewerPropsvue-json-viewer propsobjectvue-json-viewersee below
...svelte-jsoneditor propsobjectsvelte-jsoneditorsee below

Default props for svelte-jsoneditor

{ 
  mainMenuBar: false,
  mode: 'code',
}

Default props for vue-json-viewer

{
  expanded: false,
  sort: false,
  expandDepth: 1,
  copyable: { copyText: '复制', copiedText: '已复制', timeout: 2000 },
  boxed: true,
  previewMode: true,
}

Config rules

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

权重:

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

Keywords

FAQs

Package last updated on 08 May 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