N
N
nurdus2018-08-19 23:51:47
Vue.js
nurdus, 2018-08-19 23:51:47

Where to calculate an asynchronous value to pass to a child?

Good evening.
There is a component that receives a jobID from the parent and you need to asynchronously calculate the job and pass it on to the child. Question: where to calculate job?
P.S. I know about vue-async-computed, but since initially computed was made synchronous, then there was a reason for this (so I don’t want to use it)
P.S.P.S. I tried in hooks (created), but something did not work out (maybe the hands are crooked)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lemme, 2018-08-20
@nurdus

Calculate it in the parent, pass it to the child, conditionally render the child, or somehow handle the presence of data in the child.
voila
https://codepen.io/anon/pen/OoLEzb
In general, I advise you to look towards vuex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question