Answer the question
In order to leave comments, you need to log in
Vue, city search in json?
Hello.
It is necessary to implement a search on vue, the same as here when posting the question "Question tags", only take the data from a large json (800kb) i.e. The person begins to enter the name of the city and already possible options are substituted from the file. What is the best way to implement this?
Answer the question
In order to leave comments, you need to log in
Load JSON with Ajax and check the field for matching by trigger (for example, here by pressing Enter)
For example - TYTS
Look there Asynchronous select The idea is not to load anything in advance, but simply contact the server, which will return a set that matches the search criteria.
This is standard practice. It makes no sense to load the entire JSON every time, even if it is not needed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question