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
Menu