Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vue/compat

Package Overview
Dependencies
Maintainers
0
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vue/compat

Vue 3 compatibility build for Vue 2

  • 3.5.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
181K
increased by0.53%
Maintainers
0
Weekly downloads
 
Created

What is @vue/compat?

@vue/compat is a compatibility build of Vue 3 that allows you to gradually migrate your Vue 2 applications to Vue 3. It provides a way to use Vue 3 features while maintaining compatibility with Vue 2 syntax and APIs.

What are @vue/compat's main functionalities?

Compatibility Mode

This feature allows you to create a Vue 3 application that is compatible with Vue 2 syntax and APIs. The code sample demonstrates how to create and mount a Vue application using @vue/compat.

import { createApp } from '@vue/compat';
import App from './App.vue';

const app = createApp(App);
app.mount('#app');

Migration Build

The migration build feature allows you to configure the compatibility mode to help identify and fix issues during the migration process. The code sample shows how to set the compatibility mode to Vue 2.

import { createApp } from '@vue/compat';
import App from './App.vue';

const app = createApp(App);
app.config.compatConfig = { MODE: 2 };
app.mount('#app');

Runtime Warnings

This feature provides runtime warnings to help you identify deprecated or incompatible APIs. The code sample demonstrates how to set up a custom warning handler to log warnings to the console.

import { createApp } from '@vue/compat';
import App from './App.vue';

const app = createApp(App);
app.config.warnHandler = function (msg, vm, trace) {
  console.warn(`[Vue warn]: ${msg}${trace}`);
};
app.mount('#app');

Other packages similar to @vue/compat

Keywords

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc