Atef95
2 months ago
274
3
Vue

props component rendering issue

Posted 2 months ago by Atef95

Heyy guys

I have this child component below

it displays a list of articles..

  <show-articles v-if="selected_articles.length > 0" :articles="this.articles"
                        :oldSelectedArticles="this.selected_articles" @submitArticles="affectArticles($event)">
                    </show-articles>

if user has selected one of them it's gonna be checked otherwise not..

the issue that the variable selected_articles gets populated by an axios api..

when selected_articles is empty the component doesn't show at all..

  <show-articles :articles="this.articles"
                        :oldSelectedArticles="this.selected_articles" @submitArticles="affectArticles($event)">
                    </show-articles>

when I try to remove it, the component get showed up before waiting the api call to finish! so selected_articles will be something like [ob: Observer]

how can I fix this please?

Please sign in or create an account to participate in this conversation.