A
A
Alexander2018-05-17 11:48:30
Vue.js
Alexander, 2018-05-17 11:48:30

How does vue interact with the backend?

Vue renders the page from the data passed to it in the object, i.e. it turns out the server gives the html page, the client receives the page and an ajax request is sent to the server to get the necessary data, the server gives json, I pull the data from json in js and give it to vue, is that all right? Or is it done in some other way?
It turns out that the frontend and backend are no longer as closely connected as, for example, in wp or other cms, where templates are processed on the server and ready-made html is given. It turns out that on the frontend it doesn’t matter at all what and how it works on the server, the main thing is that the necessary json would come in response, right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Sorokin, 2018-05-17
@smoyke

It is also possible that Vue is rendered on the server side. This is when the server itself puts the data into templates, then parses the vue components to the html string and gives such a variant to the client. This mechanism is called server rendering. Your described mechanism is called client-side rendering. If you combine them, you get an isomorphic application.

M
Moe Green, 2018-05-24
@mQm

All right.
In the case of Vue, we can say that there is a "classic" option when a SPA application.
And there is a closer connection between Vue and the backend - this is Nuxt.js (SSR).
In this case, you can integrate a close relationship with the backend using Express.js or Koa.js, for example. But this requires good knowledge of the backend - Node.js, MongoDB, Mongoose.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question