Giter Site home page Giter Site logo

jsonview-vue's Introduction

jsonview-vue

可折叠的方式查看json数据

use

1、 安装

npm install jsonview-vue -S

2、 引入

import JsonView from 'jsonview-vue';
import Vue from 'vue';

Vue.use(JsonView);
// 在组件中引入
import { jsonView } from 'jsonview-vue';

// ...
// components: {
//    jsonView
// }
// ...

script标签引入js

// 1、Vue.use
Vue.use(JsonView);


// 2、组件中注册
// ...
// components: {
//    jsonView: JsonView.jsonView
// }
// ...

3、使用

3.1) props

json: 必需,需要查看的json对象,object和array都可

<json-view :json="{a: 123}"></json-view>

closed: 非必需,默认为true,为折叠状态。是否为折叠状态 注: 内容的折叠状态,是用v-if来实现的,所以当closed为true的时候是可以展示有环的对象。如果为false,对象有环会报错,请根据实际情况设置该值

<json-view :json="{a: 123}" :closed="false"></json-view>

jsonview-vue's People

Contributors

dyw934854565 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.