Skip to content

Commit 7d370e4

Browse files
author
yaroslav8765
committed
feat: add dark theme to the jsonViewer and updated docs
1 parent ece89d2 commit 7d370e4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

adminforth/documentation/docs/tutorial/03-Customization/15-afcl.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,28 +1738,22 @@ import { JsonViever } from '@/afcl'
17381738

17391739
<div>
17401740
```html
1741-
<JsonViewer
1741+
<JsonViewer
17421742
:value="[
17431743
{
17441744
id: 1,
17451745
name: 'Alice',
17461746
meta: {
17471747
age: 30,
17481748
hobbies: ['reading', 'biking'],
1749-
location: { city: 'Kyiv', country: 'Ukraine' }
17501749
}
17511750
},
17521751
{
17531752
id: 2,
17541753
name: 'Bob',
1755-
meta: {
1756-
age: 25,
1757-
active: true,
1758-
scores: { math: 92, english: 88 }
1759-
}
17601754
}
17611755
]"
1762-
:expandDepth="4"
1756+
:expandDepth="2"
17631757
/>
17641758
```
17651759
</div>
-21.1 KB
Loading

adminforth/spa/src/afcl/JsonViewer.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
:expandDepth="expandDepth"
66
copyable
77
sort
8+
:theme="currentTheme"
89
/>
910
</template>
1011

1112
<script setup lang="ts">
13+
import { computed } from 'vue'
1214
import { JsonViewer } from 'vue3-json-viewer'
15+
import { useCoreStore } from '@/stores/core'
1316
1417
defineProps<{
1518
value: any
1619
expandDepth?: number
1720
}>()
1821
22+
const coreStore = useCoreStore()
23+
24+
const currentTheme = computed(() => (coreStore.theme === 'dark' ? 'dark' : 'light'))
1925
</script>

0 commit comments

Comments
 (0)