How to gracefully obtain responsive data, dependent data.

I don"t know if the statement of responsive data is correct, let"s look at the example.
clipboard.png

as shown above
first get the region, then get the first as a parameter, then get the type, and then get the first type as a parameter to get the status

when the region changes, get the type, get the first type as a parameter to get the status.

is there any elegant way to write it that feels very redundant?

Oct.07,2021

multilevel linkage . Generally speaking, for the sake of user experience, we will choose to load the data first. Otherwise, every HTTP request is unpredictable.


there are many similar ones, such as the three-stage linkage of picker, selected by provinces, cities and autonomous regions. This group of two ideas,
1, if the data is stable and the total amount of data is small, cache all data directly
2. If the data changes frequently or the total amount is large, it is recommended to cache only first-level data, such as your region, and then each time you select a level, re-send a request to obtain the data.

at the same time, doing a good job of data coding will also make it convenient for you to check the relevant and linked data

Menu