Render data from API: select with optgroup #2906
Unanswered
josejachuf
asked this question in
1. Help
Replies: 2 comments
-
If in the select to the x-for I do it with optgroup2 it works fine, but with pptgroup (API) no, it is as if at that time the data was not yet available. |
Beta Was this translation helpful? Give feedback.
0 replies
-
There is more than I can't understand in behavior: Given:
and
If I do:
Does what I hope, hides the select. In the same way, if I do:
Show the select, although it does not work, but it shows it empty. So far is the expected behavior, but if I do:
when isDataOK is true only shows the label:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Given the following within x-data
I can do this and it works fine:
Now, if optgroup I get it from an API-rest, this does not work
I can validate that the two arrays are equal, the hardcode and the one obtained from the API
But I get the empty select
I tried to use an x-if assuming that at the time it is rendered, the data has not yet been obtained from the API, but it did not work
I understand that this is why I am using it badly.
In short, if I use the hardcoded array works, if I use the array from the API, no. And I don't know how to solve it
Jose
Beta Was this translation helpful? Give feedback.
All reactions