How does a vue recursive component pass events to the parent component?

for example, according to the data traversal recursion, it is not clear how many times it will be traversed. The form is as follows:

<parent>
    <children>
        <children>
            <children>
                ...
            </children>
        </children>
    </children>
</parent>

I"m going to children data to parent for reception at the last layer, but emit can only pass it up one layer. Is there a good solution? I don"t have any good ideas except using vuex

Mar.10,2021

use eventBus policy.
definition:

  https://developer.mozilla.org.

Menu