All Projects → michaelfitzhavey → Vue Json Tree View

michaelfitzhavey / Vue Json Tree View

Licence: mit
A JSON Tree View Component for Vue.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Json Tree View

Vue Prism
Simple Vue.js Syntax highlighting with Prism.js
Stars: ✭ 43 (-89.71%)
Mutual labels:  vuejs2, javascript-library
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-62.68%)
Mutual labels:  tree, vuejs2
Vue.d3.tree
Vue component to display tree based on D3.js layout.
Stars: ✭ 726 (+73.68%)
Mutual labels:  tree, vuejs2
indexed-string-variation
Experimental JavaScript module to generate all possible variations of strings over an alphabet using an n-ary virtual tree
Stars: ✭ 16 (-96.17%)
Mutual labels:  tree, javascript-library
Angular Tree Component
A simple yet powerful tree component for Angular (>=2)
Stars: ✭ 1,031 (+146.65%)
Mutual labels:  tree, javascript-library
Tui
This is a high quanlity components library for VUE
Stars: ✭ 258 (-38.28%)
Mutual labels:  vuejs2, javascript-library
Midiwriterjs
♬ A JavaScript library which provides an API for programmatically generating and creating expressive multi-track MIDI files and JSON objects.
Stars: ✭ 381 (-8.85%)
Mutual labels:  javascript-library
Notebook
my notebook 📒
Stars: ✭ 405 (-3.11%)
Mutual labels:  tree
Algorithms
Minimal examples of data structures and algorithms in Python
Stars: ✭ 20,123 (+4714.11%)
Mutual labels:  tree
Vue Acl
Access Control List plugin for VueJS 2.0
Stars: ✭ 376 (-10.05%)
Mutual labels:  vuejs2
Cheetah Grid
The fastest open-source data table for web.
Stars: ✭ 417 (-0.24%)
Mutual labels:  javascript-library
Scrollload
scroll bottom load more data pull refresh 滚动到底部加载更多数据 下拉刷新
Stars: ✭ 411 (-1.67%)
Mutual labels:  javascript-library
Vue Sample Svg Icons
An opinionated example of how to use SVG icons in a Vue.js application
Stars: ✭ 399 (-4.55%)
Mutual labels:  vuejs2
Functional Javascript
Functional is a library for functional programming in JavaScript. It defines the standard higher-order functions such as map, reduce (aka foldl), and select (aka filter). It also defines functions such as curry, rcurry, and partial for partial function application; and compose, guard, and until for function-level programming.
Stars: ✭ 383 (-8.37%)
Mutual labels:  javascript-library
Vue Spotify
Spotify client built with vue.js / vuex
Stars: ✭ 407 (-2.63%)
Mutual labels:  vuejs2
Enlighterjs
🔆 an open source syntax highlighter written in pure javascript
Stars: ✭ 379 (-9.33%)
Mutual labels:  javascript-library
Creepyface
A JavaScript library that makes your face follow the pointer. 🤪🖱️👆
Stars: ✭ 412 (-1.44%)
Mutual labels:  javascript-library
Dimpleblog
个人博客,目前3.0v版本正在开发中
Stars: ✭ 379 (-9.33%)
Mutual labels:  vuejs2
Pageswitch
Just a page-Switch Javascript Library
Stars: ✭ 397 (-5.02%)
Mutual labels:  javascript-library
Inspire Tree
Inspired Javascript Tree
Stars: ✭ 409 (-2.15%)
Mutual labels:  tree

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" :options="{maxDepth: 3}"></tree-view>
</div>

Props

data

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

options

The defaults are:

{
  maxDepth: 4,
  rootObjectKey: "root",
  modifiable: false,
  link: false,
  limitRenderDepth: false
}
  • 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.
  • modifiable: To modify the json value.
  • link: URL strings will appear as clickable links (unless modifiable="true").
  • limitRenderDepth: maximum number of nodes that should be rendered (for very large JSONs)

Event

updated json data

If modifiable is true and you want to take the updated json data, you must register event handler as v-on:change-data=.... Only one argument is passed that is updated data - data.

<div>
  <tree-view :data="jsonSource" :options="{modifiable: true}" @change-data="onChangeData"></tree-view>
</div>

// in your vue code
  ...
  methods: {
    onChangeData: function(data) {
      console.log(JSON.stringify(data))
    }
  },
  ...

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.

Keys can also be styled. For instance to make labels red:

.tree-view-item-key {
    color: red;
}

Contributing

Contributions to this repo are very welcome as they are what has helped it become what it is today. Simply raise an issue with new ideas or submit a pull request.

A github action automatically deploys changes when they are merged into the master branch.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].