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

MathewHany's avatar

Is Vue.js just for single page applications?

Is Vue.js just for single page applications?

0 likes
20 replies
MathewHany's avatar

Does that mean I can't use it in a big laravel application?

mstnorris's avatar
Level 55

@MathewHany no it isn't just for SPAs. You can use it however you like. And yes, you can use it in any size Laravel app.

@Ruffles what is your comment based on? Vue.js can be used just like any other JavaScript library.

5 likes
belisar's avatar

@MathewHany ,

How do you define a 'Big Laravel Application'?

It has nothing to do with the size of your Laravel application. Vuejs appeal is exactly in the fact that it does not assume you will build a SPA.

adamwathan's avatar

I would say Vue is just the opposite. It can do SPA, but out of the box it works perfectly for sprinkling in the odd component here or there into a mostly server-rendered app. Perfect companion for Laravel. It's in the same space as Knockout really, just better in every way.

2 likes
jekinney's avatar

Yes instead of jquery I use vue. Just an easy wrapper for JavaScript imo that helps with repetitive and common tasks.

1 like
jimmy.puckett's avatar

Read the 2nd point under Angular on the official docs...

http://vuejs.org/guide/comparison.html

"... It’s only an interface layer so you can use it as a light feature in pages instead of a full blown SPA. It gives you bigger room to mix and match with other libraries, but you are also responsible for making more architectural decisions."

1 like
davorminchorov's avatar

@mstnorris Well, I might be wrong (and I probably am) but I believe that the whole point of these new JavaScript frameworks which come out every day is all about improving the user experience and make the life of the developers easier.

The new way of building apps is to go for Single Page Apps but that doesn't mean the traditional web apps will die right away.

Single page apps are not for everything! They have their own advantages, especially when a lot of new apps today are coming out with and API for mobile or other devices.

mstnorris's avatar

I believe that the whole point of these new JavaScript frameworks which come out every day is all about improving the user experience and make the life of the developers easier.

You're right on that point. They do make our lives easier as they speed up common tasks, and add expected functionality right out the box.

This has very little to do with Vue.js though as the OP asked. Yes, Vue.js can be used for SPAs, but it isn't solely for that purpose. :)

1 like
jlrdw's avatar

Vue js is used to cause over thinking. JavaScript should only be used sparingly in a web database application. Like a lookup table and maybe a pop up calendar and nothing else. Some people falsely believe that JavaScript and Ajax enhance a site when in reality most people that use these techniques over use them and it makes for a worse page.

mstnorris's avatar

@jlrdw your thought process is very outdated.

JavaScript should only be used sparingly in a web database application. Like a lookup table and maybe a pop up calendar and nothing else.

That's a crazy limitation to impose, based on absolutely nothing. JavaScript is an incredibly powerful language that can do amazing things. I agree with you that in the "wrong hands" it can be detrimental to the user experience, but so can anything. You mentioned the other day that you're happy with standard data entry using the likes of Microsoft Access, and Java applications. Most of which, in my opinion, are ugly as hell to say the least and have some of the worst user experiences going.

The same way I used dbase 3, visual foxpro, and later java servlets, jsp, and javabeans. But I was the database manager at a large trucking company, it was a business application I wrote and maintained over the years, truck dispatch, accounts receivable, accounts payable, driver payroll, etc. So the usage of a framework can be widespread. I don't care about some of these modern looking sites with the thrills and over use of javascript. My focus is buisness style application. If you ever used microsoft access, and entered data on a form, that type of thing.

I reiterate that I agree with you on part that libraries can be abused and overused, but to rule them out on this basis alone is nonsensical as you'd have to throw out everything else along with it.

2 likes
jlrdw's avatar

I agree if used wisely, it's fine, but as an example I see no reason to ever use it for pagination. But to simply show some data "on the fly" on your form like in a division now that's okay. Or even an image pop-up.

davorminchorov's avatar

I think that JavaScript has a lot more power than just a popup calendar or a similar widget. You underestimate the power.

The overuse part, that can be said about any language / technology / technique.

1 like
jlrdw's avatar

Powerful yes, secure as server side no. I can tell some of you has never programmed for a State government.

davorminchorov's avatar

It's not supposed to be secure because front-end is mainly for better user experience.

2 likes
Prullenbak's avatar

It's in the same space as Knockout really, just better in every way.

Exactly. I hear/see everyone compare it to angular and ember, but to me it's more like a way better knockout.

thomaskim's avatar

I absolutely love vue.js. I use it for almost everything. The only times when I don't is when I have to support IE8 and below.

But overall, the combination of Laravel, vue.js, and elixir have drastically increased my productivity.

matzeso's avatar

@JLRDW - I came here from Google and decided it would be necessary to comment on @jlrdw 's comments.

I wonder why not more people have outspoken to this but Javascript is a powerful language, and I would really like to know how you come to the conclusion that it is not secure "as server side". If a SPA is not secure, it is the fault of the developer. The SPA does not make the server side obsolete, all data operations are still handled in the backend - and by the way, that can very well be JavaScript as well. Your assumptions are, in my point of view, baseless.

I can very well tell that by showing off how secure you develop in Access, and that you worked for state government, you must have worked in Germany. Our government loves outdated technology as well. As for me, I have worked 7 years as an IT consultant for government controlled municipal utilities, especially with Oracle and Access, and have 10+ years experience in PHP / JavaScript and I would always prefer to do anything I can do in JavaScript / Vue.js with HTML / CSS over a Microsoft Access application.

If you are looking for information on Vue.js, don't hesitate to start working with it. It's incredible, simple to learn, powerful and fast. If you still work with jQuery, drop it if possible and make the change. You will not regret it. You will not look back.

1 like
nomikz's avatar

First of all, Vue.js is just a framework. JavaScript framework. Doing the moderately complex site using plain javascript would be a nightmare. With framework, it easy to scale the project because it is easy to read vue.js code rather than piles of js code even though it can now be modular.

Javascript's modules is syntactic sugar. Developers of JS are trying to add more OOP features to make it more attractive and easy for other developers.

Back to your question. No vue's only purpose is not just spa. Almost all the things you do with js, you can do with vue. It is just a frame on top of JS. It is like laravel for php. You can focus more on the problem solving rather than on developing.

I used to wonder given that SPA is so cool why are we still using MV*. Turns out SPA has few big limitations. The biggest one is for SEO. SEO is huge, huge factor. For some sites it its the only important factor not the technology stack at all.

You can make some parts of you site spa wher seo is not a factor.

Site of Angular is marvellous. Such a big documentation so few requests.

But best spa is gmail. Most people just dont notice how great ux gmail has.

Please or to participate in this conversation.