You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-json-tree-view

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-json-tree-view

a JSON Tree View Component in Vue.js

2.0.2
Source
npmnpm
Version published
Weekly downloads
13K
2.6%
Maintainers
1
Weekly downloads
 
Created
Source

Vue JSON Tree View

a demonstration

Demo and Blogpost

You can check out the demo on JSFiddle and read the Blogpost called Building a JSON Tree View Component in Vue.js from Scratch in Six Steps that lead to the creation of this library.

Installation

Install the plugin with npm:

npm install --save vue-json-tree-view

Then, in your Application JavaScript, add:

import TreeView from "vue-json-tree-view"
Vue.use(TreeView)

Done.

Usage

Put the tree-view element into your HTML where you want the Tree View to appear.

<div>
  <tree-view :data="jsonSource" max-depth="3"></tree-view>
</div>

Props

data

The JSON to be displayed. Expects a valid JSON object.

options

The defaults are:

{
  maxDepth: 4,
  rootObjectKey: "root"
}
  • maxDepth: The maximum number of levels of the JSON Tree that should be expanded by default. Expects an Integer from 0 to Infinity.
  • rootObjectKey: the name of the Root Object, will default to root

Custom Styling

All leaves will have their type indicated as a CSS class, like tree-view-item-value-string. Supported types: String, Number, Function, Boolean and Null Values.

Notes

Enjoy.

Changelog

  • 2.0.0: Moved prop based option into options object. Added CSS for leaf types. Support for raw values as data.
  • 1.0.0: Initial Release

Keywords

vue-component

FAQs

Package last updated on 19 Feb 2017

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