Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue: is multiple Vue apps for a single website okay? [closed]

Tags:

vue.js

vuejs2

I have a Hugo static website that I am making dynamic using Vue. We are transitioning. The long term plan is not yet confirmed but in the intermediate stage we are using Vue.

I already have a Vue app on one page and now I need to implement another page using Vue. So I am thinking that I will make another Vue app for that. Is this acceptable practice or is it against the recommended practice?

First vue app is for submitting a form. Second is for getting and displaying a list of items.

like image 810
nxmohamad Avatar asked Apr 09 '18 09:04

nxmohamad


People also ask

Can you have multiple Vue instances?

Working with multiple Vue instancesIt is totally legal and fine to have multiple Vue instances on your page controlling different parts and pieces of it. In fact, you can even have your instances communicate with each other by storing them in variables within the global namespace.

Is Vue a single-page app?

This type of application is typically referred to as a Single-Page Application (SPA). Vue provides core libraries and comprehensive tooling support with amazing developer experience for building modern SPAs, including: Client-side router.

Is Vue good for large applications?

Vue. js 3 is a solid framework for building applications both large and small.


1 Answers

Definitely it's acceptable practice.

Vue can be used for single-page apps, but there's nothing wrong in using it in a traditional multiple page-based application. In this context, one Vue app can be one "widget" on such a page, big or small.

The need to have one "central" component will come the moment you'll require sharing data between multiple components. You'll probably get there - but you don't need to worry about it now.

In fact, one of major advantages of Vue is the ease of use in this particular setup. You can introduce it to your codebase step by step, start with a few components, and slowly make your way towards a modern app.

GitLab is known for going through a major progressive rewrite from jQuery to Vue, have a look at their story:

  • Why we chose Vue
  • How we do Vue: one year later
like image 147
Kos Avatar answered Sep 18 '22 05:09

Kos