vue-json-tree-view
Advanced tools
Comparing version
10
index.js
@@ -15,3 +15,13 @@ import Vue from 'vue'; | ||
}; | ||
}, | ||
methods: { | ||
onChangeData: function(data) { | ||
this.sampleJSON = data | ||
} | ||
}, | ||
watch: { | ||
sampleJSON: function() { | ||
console.log('updated sampleJSON') | ||
} | ||
} | ||
}); |
{ | ||
"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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
363580
130.85%21
10.53%87
35.94%134
-63.39%1
Infinity%