How to get state in real time in vue?

The

array is stored in state, and the page needs to be updated in real time as it changes.
the official document uses the calculation attribute computed. I usually pass it directly in the parent component and get it with props, so that when the state changes, it can directly affect the current component.
is there any difference between the two ways?

May.30,2022

the difference is that the data is changed in a different way.
parent and child components use emit
computed in the vuex way


if you need the value of this array after some calculation, use computed
for example, you want to filter map reduce the array passed in by prop or calculate it with other state and props to get its return value and then act on the current component

if you don't need the calculated array values, you can just take advantage of this prop

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