Vue Click li (not a loop of li), to show the inexplicable loop of the subcomponent

1. Subcomponent, $emit has a show method
clipboard.png

2.
clipboard.png

3.
clipboard.png

4.
clipboard.png

5.:console:
clipboard.png

6. What"s the question? Thank you for your help.

Mar.05,2021

you annotate the following this.$refs.selectDialog.show ()
to see the effect.


this.$refs.selectDialog.show () is also the show method of calling the child component, and the show method triggers the showSelectDialog method of the parent component. The so loop calls the show method of the child component in the


parent component. Once again, the child component gives a method to the parent component, and the parent component continues to call the child component after receiving the method. The sub-component emit, such an endless loop again, just remove $emit

Menu