v-code-diff is a Vue.js component designed for visually displaying code differences, supporting both Vue 2 (2.6.0+) and Vue 3 environments through its `vue-demi` integration. The current stable version is 1.13.1, with active development on the 1.x branch. This library differentiates itself by offering seamless cross-version compatibility for Vue projects, allowing developers to integrate robust code diffing capabilities regardless of their specific Vue ecosystem version. It builds upon established projects like `vue-diff` and `vue-code-diff`, and leverages `highlight.js` for extensive language support, defaulting to plaintext but configurable for numerous programming languages. The component supports both local and global registration, with local registration being the recommended approach for optimal tree-shaking. A clear migration path from the older 0.x versions to the current 1.x series is provided to simplify transitions.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Use named import for local component registration, especially in Vue 3 setup scripts or Vue 2 component options.
For global plugin registration with `Vue.use()` or `app.use()`, the library exports itself as a default export.
This library is primarily designed for ESM consumption. While bundlers handle CJS, direct `require` might not resolve correctly for named exports without specific configuration.
This quickstart demonstrates local registration of the `CodeDiff` component in a Vue 3 application, showing a side-by-side comparison of two JavaScript code strings with line numbers.
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.
No traffic data recorded yet.