S
S
ssvwvhas2018-06-11 12:10:23
Vue.js
ssvwvhas, 2018-06-11 12:10:23

Do I understand correctly the principle of creating a main SPA entry point?

Good day. I was wondering how to create a single page application on vue.js using Laravel as api.
Did I understand correctly that when requesting for the first time, the server will give us an empty html page, and after the page has loaded, vue will send another request to the api to get the data already. It turns out that when loading the page, the browser will send two requests to the server. Or did I misunderstand? What is better to read for creating such applications?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Malyarov, 2018-06-11
@Konstantin18ko

First, the client will receive html markup (not empty html), then it will receive data, which will then be exposed to html markup.
If you want to avoid this, then you need to use ssr rendering on the server side https://ssr.vuejs.org/ru/
Yes, there are more than one request.
1. Request html markup.
2. Request for goods API.
3. API request for customer data.
That's three requests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question