Vue project city selection page-brother component data transfer value (8-6)

Data transfer of sibling components

In fact, brothers pass on value from the son to the father, and then the father passes on to another son. Realize the brothers pass by value.

I want the English letters on the right to switch with those on the left.
The first one: Click the letter on the right and switch on the left.
The second one: slide the letters on the right, and follow the slide on the left.
Insert picture description here

  1. Bound event
    Insert picture description here
  2. Outgoing events
    Insert picture description here
  3. Receive event
    Insert picture description here
  4. Invoke methods based on events
    Insert picture description here
  5. Return subcomponent
    Insert picture description here
  6. Receive data and listen
    Insert picture description here

important point:

:ref $refs in vue How to access DOM elements in Vue
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45647118/article/details/114275614