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 - npm Package Compare versions

Comparing version

to
2.1.0

src/TreeViewItemValue.vue

@@ -15,3 +15,13 @@ import Vue from 'vue';

};
},
methods: {
onChangeData: function(data) {
this.sampleJSON = data
}
},
watch: {
sampleJSON: function() {
console.log('updated sampleJSON')
}
}
});

2

package.json
{
"name": "vue-json-tree-view",
"version": "2.0.7",
"version": "2.1.0",
"repository": "arvidkahl/vue-json-tree-view",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/arvidkahl/vue-json-tree-view",

@@ -46,3 +46,4 @@ # Vue JSON Tree View

maxDepth: 4,
rootObjectKey: "root"
rootObjectKey: "root",
modifiable: false
}

@@ -52,3 +53,25 @@ ```

- rootObjectKey: the name of the Root Object, will default to `root`
- modifiable: To modify the json value.
## 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`.
```html
<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

@@ -55,0 +78,0 @@

@@ -0,1 +1,2 @@

import TreeViewItemValue from './TreeViewItemValue.vue';
import TreeViewItem from './TreeViewItem.vue';

@@ -5,4 +6,5 @@ import TreeView from './TreeView.vue';

module.exports = function install(Vue){
Vue.component("tree-view-item-value", TreeViewItemValue);
Vue.component("tree-view-item", TreeViewItem);
Vue.component("tree-view", TreeView);
};

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet