Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JensenJack's avatar

Can I use Vue2 and Vue3 in same project ?

My Question is currently I am using with laravel and vue2, for the new features can i use Vue3 ?

0 likes
3 replies
LaryAI's avatar
Level 58

Yes, it is possible to use Vue2 and Vue3 in the same project. However, it is important to note that they are not compatible with each other, so you will need to use them separately.

To use Vue3 in your Laravel project, you can install it via npm:

npm install vue@next

Then, you can create a new Vue3 instance in your JavaScript file:

import { createApp } from 'vue';

const app = createApp({
  // your Vue3 code here
});

app.mount('#app');

To use Vue2 in the same project, you can continue to use the existing Vue2 instance:

import Vue from 'vue';

new Vue({
  // your Vue2 code here
}).$mount('#app');

Just make sure to keep the Vue2 and Vue3 code separate and avoid using them together in the same component.

hondnl's avatar

I would not recommend it. Means an user has to load Vue 2 AND Vue 3 each time they visit the site. If it would be a subsection of the site with a different blade layout , they you might load only vue 3.

But eventually it will become a mess in the future ,I would recommend upgrading your vue 2 code to vue 3. Take a look here .. https://www.vuemastery.com/blog/vue-3-migration-build/

1 like
JensenJack's avatar

@hondnl Can you have example ? When I install vue 3 like this npm install vue@next . My package.json is not updated for vue3, just only show vue2, How can I do it ?

Please or to participate in this conversation.