Vue multiple dynamic likes (child component modifies parent component value)

there is a dynamic article array posts_list. Each item in the array has a like status and a number of likes. I need to package likes separately, and I will change the status and quantity when giving likes. Child components cannot directly modify the value of the parent component, and it can be troublesome to publish subscriptions with custom events. I need to know which item in the array to like, and then modify it in the parent component. Is there any other better way?

May.12,2022

  • parent component passes in id ( props )
  • After the

    child component triggers the like event ( @ click ), activate an event for the parent component:

      

    do not want to use the method of passing values between components, you can use vuex, the status and number of likes are all put in the state, no matter which component you modify, state is dynamic.

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