summaryrefslogtreecommitdiff
path: root/src/components/jsonDiff.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/jsonDiff.vue')
-rw-r--r--src/components/jsonDiff.vue42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/components/jsonDiff.vue b/src/components/jsonDiff.vue
new file mode 100644
index 0000000..7b5a077
--- /dev/null
+++ b/src/components/jsonDiff.vue
@@ -0,0 +1,42 @@
+<template>
+ <div>
+ <CodeDiff
+ :hideHeader="false"
+ language="json"
+ :old-string="oldJson"
+ new-string="{}"
+ output-format="line-by-line"
+ :theme="theme"
+ />
+ </div>
+</template>
+
+<script setup>
+import { ref, watch } from 'vue';
+import { CodeDiff } from 'v-code-diff';
+import { useMainStore } from '@/store/index';
+const mainStore = useMainStore();
+
+
+let oldJson = {
+ a: {
+ b: {
+ c: "66666666666666666666666666666666666666666666666",
+ },
+ },
+};
+
+oldJson = ref(JSON.stringify(oldJson, null, 2));
+
+let theme = ref(mainStore.theme);
+
+watch(
+ () => mainStore.theme,
+ (value) => {
+ theme.value = value
+ }
+);
+
+</script>
+
+<style lang="scss" scoped></style>