Vue JSON Compare Component

3.0.0 · abandoned · verified Sun Apr 19

vue-json-compare is a Vue 2.x component designed for visually comparing two JSON objects or arrays. It accepts `oldData` and `newData` props, highlighting structural and value differences in a side-by-side, hierarchical display. The current stable version, 3.0.0, was last published over 5 years ago and is exclusively compatible with Vue 2 applications. Given that Vue 2 officially reached its end-of-life on December 31, 2023, this package is effectively deprecated and unsupported for new projects. Its primary differentiator was providing an immediate UI solution for JSON diffing within Vue 2 ecosystems, contrasting with lower-level JavaScript diffing libraries by offering a complete visual component. The project appears to be abandoned, with no active development or known support for Vue 3.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates basic usage by importing and registering the `vue-json-compare` component, then passing two JSON objects, `oldData` and `newData`, as props to display their differences.

<template>
  <div>
    <vue-json-compare :oldData="oldData" :newData="newData"></vue-json-compare>
  </div>
</template>

<script>
import vueJsonCompare from 'vue-json-compare';

export default {
  components: {
    vueJsonCompare
  },
  data () {
    return {
      oldData: {
        id: 1,
        name: 'Alice',
        settings: { theme: 'dark', notifications: true },
        tags: ['user', 'admin']
      },
      newData: {
        id: 1,
        name: 'Alicia',
        age: 30,
        settings: { theme: 'light', notifications: true },
        tags: ['user', 'premium']
      }
    };
  }
};
</script>

view raw JSON →