Appearance
ContentJsonViewer
A JSON tree on nested details elements, with search, path and copy.
ts
import { ContentJsonViewer } from '@zairakai/vue-components/Content'Usage
vue
<ContentJsonViewer />Example
{3}
- "Ada"
[2]
- "en"
- "fr"
{1}
- "London"
vue
<template>
<ContentJsonViewer
:value="{ name: 'Ada', langs: ['en', 'fr'], address: { city: 'London' } }"
:expanded="2"
/>
</template>Props
| Name | Type | Default | Description |
|---|---|---|---|
id | string | ||
class | string | ||
value | null | null | |
expanded | number | 1 | How many levels are open at the start. |
search | string | '' | Open and mark what contains this text. |
label | string | 'JSON' | |
copyable | boolean | true | |
copyLabel | string | 'Copy' | |
copiedLabel | string | 'Copied' |
Events
| Name | Description |
|---|---|
select |
See Theming for the class hooks and the data-* state of the components.