Element Cascader cascade selector encapsulates the recycling component, and the problem of getting the value through the ref attribute

The

project uses a subcomponent encapsulated by an element Cascader cascade selector (figure 1). Normally, the selected content can be obtained directly through this.$refs.XX.
but the page is a subcomponent of the circular call (figure 2 below), which renders the subcomponent multiple times based on the returned data item. At this point, the subcomponents are used multiple times. Because ref can only be unique, how to define it dynamically? Or is there any other way to get the subcomponents and get the contents?

Mar.14,2021

ref can be dynamic, but you need to define the corresponding relationship yourself. Write an example that you can refer to. https://jsfiddle.net/j6xkmvcy/

Menu