stacker's avatar

Need enlightenment on Vue

I started learning Vue recently and from some reason it got stick to me that Vue is supposed to build SPA apps. (You can even see my other posts which show how ignorant I am in this matter)

But I think I realized that it's not, and it's just a way to build frontend parts using JS. Not only SPAs. So if I want to build an ecommerce website using Laravel and Vue, I will end up having something like certain blade.php files and each of them should have the corresponding Vue script and Vue html tags inside the <div id=app></div>

Did I get it right?

0 likes
4 replies
martinbean's avatar

@stacker Vue is just a JavaScript library. It allows you to make components. So no, it’s not exclusively for SPAs.

1 like
vitorhugomattos's avatar

As @martinbean said, Vue is just a JavaScript framework, but unlike every other JS framework, it gives you a variety of choices on how to use it. You can use it to build SPAs, you can use it to build pages like you described (using the SFC [single file component] - approach) or use it to write something like web components. It's up to you.

1 like
jlrdw's avatar

You can read the intro to vue,

also perfectly capable of powering sophisticated Single-Page Applications

An excerpt, which shows also spa. Why not watch their free introductory video.

2 likes
stacker's avatar

Thanks everyone!

You can read the intro to vue,

the word also could have really helped me had I read it. I should start reading docs more in-depth

Please or to participate in this conversation.