If an event is required in vue, the global method is called if it is not called by a single page.

globally, there is an event to be called by default, but before calling, it is necessary to determine whether the subcomponent is set separately. If it is set, use the subcomponent, and if there is no global event by default, think about it and find the method

.

https://jsfiddle.net/v1un4r4s.

like this


can be achieved, I provide an idea: set a global variable ifSetFlag (to determine whether the subcomponent is set separately), if the subcomponent sets ifSetFlag:true, otherwise false;, then judge that ifSetFlag, defaults to the global if it is false, and true uses the subcomponent.

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-1e48a69-4c3d7.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-1e48a69-4c3d7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?