-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The tree is not displayed when fetching data from API #74
Comments
this.tree = response.data.data;
this.tree=this.prepareData(this.tree); This looks suspiscious. Try: this.tree=this.prepareData(response.data.data); |
@David-Desmaisons Thanks David, I tried but still nothing is shown. Here is a sample of my data if you could have a look:
To be specific, the small circle of the root is shown, only that circle, nothing else. |
The problem is solved by adding v-if=“dataLoaded” on the tree component and set the dataLoaded property to true loading the data. Also, I had to use json object instead of json string. |
Hi.
I'm trying to display the tree with data fetched from the API. The tree is shown very well when using the same data as static, but it is not shown when fetching it from the API. The "console.log" in created() function prints the data as JSON string which means the data is fetched successfully. I used the "props identifier" but still nothing is displayed.
Here is my code if you could have a look
The HTML part:
ProductTree.vue script:
In Products.vue, I have:
<div> <ProductTree /> </div>
Am I missing anything?
The text was updated successfully, but these errors were encountered: