Gathering detailed insights and metrics for vue-json-viewer
Gathering detailed insights and metrics for vue-json-viewer
Gathering detailed insights and metrics for vue-json-viewer
Gathering detailed insights and metrics for vue-json-viewer
npm install vue-json-viewer
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
560 Stars
148 Commits
92 Forks
4 Watching
4 Branches
12 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
Vue (65.83%)
JavaScript (33.07%)
HTML (0.87%)
CSS (0.23%)
Cumulative downloads
Total Downloads
Last day
-9.5%
6,749
Compared to previous day
Last week
3.6%
37,869
Compared to previous week
Last month
0.3%
162,129
Compared to previous month
Last year
76.5%
1,840,446
Compared to previous year
1
1
32
Simple JSON viewer component, for Vue.js 2 or 3.
Support for incremental update components
Using npm:
$ npm install vue-json-viewer@2 --save
// Vue2
$ npm install vue-json-viewer@3 --save
// Vue3
Using yarn:
$ yarn add vue-json-viewer@2
// Vue2
$ yarn add vue-json-viewer@3
// Vue3
1<json-viewer :value="jsonData"></json-viewer> 2 3<hr /> 4 5<json-viewer 6 :value="jsonData" 7 :expand-depth=5 8 copyable 9 boxed 10 sort></json-viewer>
1import Vue from 'vue' 2import JsonViewer from 'vue-json-viewer' 3 4// Import JsonViewer as a Vue.js plugin 5Vue.use(JsonViewer) 6// or 7// components: {JsonViewer} 8 9 10new Vue({ 11 el: '#app', 12 data() { 13 return { 14 jsonData: { 15 total: 25, 16 limit: 10, 17 skip: 0, 18 links: { 19 previous: undefined, 20 next: function () {}, 21 }, 22 data: [ 23 { 24 id: '5968fcad629fa84ab65a5247', 25 firstname: 'Ada', 26 lastname: 'Lovelace', 27 awards: null, 28 known: [ 29 'mathematics', 30 'computing' 31 ], 32 position: { 33 lat: 44.563836, 34 lng: 6.495139 35 }, 36 description: `Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, 37 chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, 38 the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation, 39 and published the first algorithm intended to be carried out by such a machine. 40 As a result, she is sometimes regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.`, 41 bornAt: '1815-12-10T00:00:00.000Z', 42 diedAt: '1852-11-27T00:00:00.000Z' 43 }, { 44 id: '5968fcad629fa84ab65a5246', 45 firstname: 'Grace', 46 lastname: 'Hopper', 47 awards: [ 48 'Defense Distinguished Service Medal', 49 'Legion of Merit', 50 'Meritorious Service Medal', 51 'American Campaign Medal', 52 'World War II Victory Medal', 53 'National Defense Service Medal', 54 'Armed Forces Reserve Medal', 55 'Naval Reserve Medal', 56 'Presidential Medal of Freedom' 57 ], 58 known: null, 59 position: { 60 lat: 43.614624, 61 lng: 3.879995 62 }, 63 description: `Grace Brewster Murray Hopper (née Murray; December 9, 1906 – January 1, 1992) 64 was an American computer scientist and United States Navy rear admiral. 65 One of the first programmers of the Harvard Mark I computer, 66 she was a pioneer of computer programming who invented one of the first compiler related tools. 67 She popularized the idea of machine-independent programming languages, which led to the development of COBOL, 68 an early high-level programming language still in use today.`, 69 bornAt: '1815-12-10T00:00:00.000Z', 70 diedAt: '1852-11-27T00:00:00.000Z' 71 } 72 ] 73 } 74 } 75 } 76})
1import JsonViewer from 'vue-json-viewer/ssr' 2 3// Import JsonViewer as a Vue.js plugin 4Vue.use(JsonViewer) 5// or 6// components: {JsonViewer}
and
1import 'vue-json-viewer/style.css'
Property | Description | Default |
---|---|---|
value | JSON data (can be used with v-model ) | Required |
expand-depth | Collapse blocs under this depth | 1 |
copyable | Display the copy button, you can customize copy text just set {copyText: 'copy', copiedText: 'copied', timeout: 2000} or set true use default copytext | false |
sort | Sort keys before displaying | false |
boxed | Add a fancy "boxed" style to component | false |
theme | Add a custom CSS class for theming purposes | jv-light |
expanded | Default expand the view | false |
timeformat | custom time format function | time => time.toLocaleString() |
preview-mode | no expand mode | false |
show-array-index | array show index | true |
show-double-quotes | show double quotes | false |
Listener | Description | Value |
---|---|---|
copied | Emits copyEvent after text copied | Clipboard success event |
keyclick | click key event |
Name | Description | Scope |
---|---|---|
copy | Custom content for copy button | {copied: boolean} |
Name | Description | Scope |
---|---|---|
alt + click | expand all node |
To create custom theme, (e.g. my-awesome-json-theme
), in two easy steps:
theme="my-awesome-json-theme"
to the JsonViewer component1// values are default one from jv-light template 2.my-awesome-json-theme { 3 background: #fff; 4 white-space: nowrap; 5 color: #525252; 6 font-size: 14px; 7 font-family: Consolas, Menlo, Courier, monospace; 8 9 .jv-ellipsis { 10 color: #999; 11 background-color: #eee; 12 display: inline-block; 13 line-height: 0.9; 14 font-size: 0.9em; 15 padding: 0px 4px 2px 4px; 16 border-radius: 3px; 17 vertical-align: 2px; 18 cursor: pointer; 19 user-select: none; 20 } 21 .jv-button { color: #49b3ff } 22 .jv-key { color: #111111 } 23 .jv-item { 24 &.jv-array { color: #111111 } 25 &.jv-boolean { color: #fc1e70 } 26 &.jv-function { color: #067bca } 27 &.jv-number { color: #fc1e70 } 28 &.jv-number-float { color: #fc1e70 } 29 &.jv-number-integer { color: #fc1e70 } 30 &.jv-object { color: #111111 } 31 &.jv-undefined { color: #e08331 } 32 &.jv-string { 33 color: #42b983; 34 word-break: break-word; 35 white-space: normal; 36 } 37 } 38 .jv-code { 39 .jv-toggle { 40 &:before { 41 padding: 0px 2px; 42 border-radius: 2px; 43 } 44 &:hover { 45 &:before { 46 background: #eee; 47 } 48 } 49 } 50 } 51}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 6/8 approved changesets -- score normalized to 7
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More