Bind @ click= "add" in app.vue to define the logic of the add method on other pages

problem description

I wrote some structures as public parts in app.vue . One of the buttons (this button is the public part, which is used by many pages) is bound to @ click= "add", and then this button in the public part is used on the home page and other pages, and each page needs to define the logic of the add () method that clicks this button separately. What should I do?


< H2 > solution < / H2 >
1. Define ref in router-view first
  

it is recommended to start with vue componentization, extract the structure you are talking about into a component, and introduce
with parent-child component emit on different pages to implement-> each page defines the add () method for clicking this button separately

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b351a5-34318.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b351a5-34318.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?