插件名称 | vue-json-tree |
---|---|
发布时间 | 2020年12月27日 |
插件作者 | myst729 |
Vue组件,以可折叠的树结构呈现JSON数据。
npm install --save vue-json-tree
<json-tree>
组件。<script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
<script src="https://unpkg.com/vue-json-tree@0.4.1/dist/json-tree.js"></script>
<div id="app"></div>
<script>
new Vue({
template: '<json-tree :raw="sample"></json-tree>',
el: '#app',
data: {
sample: '{"foo": "bar"}'
}
})
</script>
vue-json-tree
通过NPM安装软件包。npm install --save vue-json-tree
import JsonTree from 'vue-json-tree'
Vue.component('json-tree', JsonTree)