I
I
Ilya Kochkin2022-03-12 07:04:33
Vue.js
Ilya Kochkin, 2022-03-12 07:04:33

How to pull data from the server in vue js?

Good afternoon, please tell me, for example, I have an ordering component, it has other components such as customer (customer information), shippingMethods (delivery methods), paymentMethods (payment methods), both in terms of "architecture" (not I know how to call it correctly) correctly pull up data from the server? pull all the data when the checkout main component is mounted and then pass them to the props of the child components or in each "child" component only the data for which it needs it.

And another question, after the client clicked to place an order, how to send the data to the server, you need to somehow collect the data in a heap? and send in a crowd, it turns out that through $ emits to transfer all the data to the parent checkout component? and send it there?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
no_one_safe, 2022-03-12
@no_one_safe

For such complex components it is better to use store
vuex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question