Excuse me, if you have experience in shopping cart, please give me some advice.

the VUE architecture project, the shopping cart in the project, allows the user to call the interface when clicking to add or decrease, pass the value to the background, and update the shopping cart.
but encountered the following problem: if the user clicks too fast, the total price and number of shopping carts will not match the actual number of shopping carts displayed in the merchandise area. Has anyone ever encountered a similar problem?

clipboard.png

Mar.29,2021

should be the problem of passing values between two components. It is recommended to use vuex


it is recommended to add "anti-shake". High-frequency clicks ensure that only the last click can succeed! It can also reduce the pressure on the server!

https://underscorejs.org/-sharpdeb.

or lock to ensure sequential execution

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