The introduction

Sometimes the demand is so caught off guard, just the day before yesterday, the product sister proposed that the current three-level linkage between provinces and cities can no longer meet our practical application, we want to make a version to support multi-level linkage, and the interaction is like this (similar to an app) smile on the surface, the heart bitter haha.

Demand point

  1. Unlimited data levels
  2. Support multiple
  3. The child node has an unlimited node. If the unlimited node is selected, the parent node is selected, and the sibling node is deselected
  4. Parent node Displays the number of selected child nodes

Identify the requirements and move on. Move.. Dynamic… Dynamic… Dynamic… Hand! I do this by using recursive components to display columns of data according to the data hierarchy.

The parent component

Child components

The end result (the UI is nothing, don’t worry about the details)