I am performing an axios
ajax request to my database for a JSON list of tags
related to a topic
which is selected using a dropdown. If no topic
value is passed, then I get a list of every tag in the database (maybe some 100-200 tags at the moment).
The steps are:
topic
from the downdownonChange
event and pass the value selected to my API using an axios get()
.topic
Obviously every time the user changes the topic
, another call to the API/Database is made. I have seen (but never used) another option of filter
When designing a form, would it be better to load all the form's option values on beforeMount()
and then filter them depending on what is selected? Or is waiting until the user selects an option before loading other options a better practice?
If amount of tags wouldn't grow dramatically I recommend to load them all at once and then just filter them by using a computed prop.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.