App.vue asynchronously requests data, and the data obtained by the subcomponent is empty.

1. I had an asynchronous request in app.vue earlier. The subcomponent needs to use this data to determine the login status. But the asynchronous request in app.vue is not finished yet, and the subcomponents have been rendered. Causes the subcomponent to display a page that is not logged in.
2. How to update the method of subcomponents after the asynchronous loading of app.vue is completed.

Mar.03,2021

use v-if to determine whether you have the data you need, and if so, render


bind a ide/components.html-sharp%E5%8A%A8%E6%80%81-Prop" rel=" nofollow noreferrer "> dynamic prop to the subcomponent. When loginStatus is updated, the subcomponent will update accordingly

.
<child :status="loginStatus"></child>
Menu