E
E
Evgeny Gridasov2018-10-01 01:12:42
Laravel
Evgeny Gridasov, 2018-10-01 01:12:42

Laravel vue-router on multipage site can be done?

Can you tell me if it is possible to use Vue-router on a multi-page site?
As far as I understand, not all laravel packages support Vue.js and they will need to be displayed on separate pages.
Maybe Vue.js can be effectively used only for microservices, and so do the pages on the site the old fashioned way
. What if I install 2 packages and they have different vue-routers?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex Wells, 2018-10-01
@Jeka2

Multi-page site - i.e. normal, with HTTP routing, where the powers of the laravel router are used and what kind of template engine is there? If so, what does vue-router have to do with it?
vue-router is needed for SPA (single page application), that is, where following a link to some thread of an internal resource only pulls JS, that is, the entire front is spinning only in the browser, and on the back (and on the laravel router) - only ajax requests fly. By itself, it has nothing to do with laravel at all, as well as vue.
And here the packages - I do not understand. Bekendovskie, from composer? Well, they are not related to vue-router at all. Front-end, from npm? Well, I don’t know such people, but I dare to assume that they give only some ready-made components, at best, and no one will dare to touch the router. Well, even if he dares - so what? You will have to transfer its instance somewhere in the library (whoever writes how), but this will be clearly indicated in the documentation.
It seems to me that you do not understand what vue, vue-router, packages and multi-page sites are. Or at least one of these :/

E
Evgeny Gridasov, 2018-11-13
@Jeka2

I'm talking about the fact that how can I redo the packages for Laravel (composer) so that the pages do not give out, but work as an api, i.e. were originally configured for api

K
Konstantin Timosheno, 2019-07-09
@kastembay

There is a routes folder for this, it has an api.php file. Write controller routes there and get it as api.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question