0.0.4 • Published 6 years ago

vue-json-pretty-fast v0.0.4

Weekly downloads
23
License
GPLv3
Repository
github
Last release
6 years ago

vue-json-pretty-fast

Build Status npm package GitHub license

A vue 2.x component for rendering JSON data as a tree structure.

Links

Install

npm install vue-json-pretty-fast

Usage

<template>
  <div>
    ...
    <vue-json-pretty
      :path="'res'"
      :data="{ key: 'value' }"
      @click="handleClick">
    </vue-json-pretty>
  </div>
</template>
import VueJsonPretty from 'vue-json-pretty'

export default {
  components: {
    VueJsonPretty
  }
}

Props

  • If you are using only the basic features (JSON pretty), just focus on the base properties.
  • If you are using advanced features (get item data), you need to focus on the base and advanced attributes.
AttributeLevelDescriptionTypeDefault
databasicjson dataJSON object-
deepbasicdata depth, data larger than this depth will not be expandednumberInfinity
pathadvancedroot data pathstringroot
pathCheckedadvanceddefines the selected data patharray[]
pathSelectableadvanceddefines whether a data path supports selectionFunction(itemPath, itemData)-
selectableTypeadvanceddefines the selected type, this feature is not supported by defaultenum: both, checkbox, tree-

Events

  • The following events are base on advanced features.
Event NameDescriptionCallback Parameters
clicktriggered when a data item is clicked(path, data)
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago