In vue, async/await is written in store, or in .vue file template.

some async/await are written in the action of vuex, and some are written in the .vue file method. Where should I write it?

Jun.15,2021

this mainly depends on whether your data is used in the current component or whether it needs to be shared by multiple components. If the component is exclusive, put it in .vue, on the contrary, put it in vuex


action can do asynchronous operation. Split it out as much as possible, and don't put it in .vue

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