[Vuejs]-Vue app, Javascript, conditionally adding an Object to an array

0👍

This seems more of a data structure issue rather than a syntax or coding issue. In your case I’d add a duplicate pizza, one for each size. That way you can still increment the amount. IE:

  • Pineapple Pizza (small) 1x

  • Pineapple Pizza (large) 1x

    You’d have to restructure your data if you’d want to

  • Pineapple Pizza 2x (small & large)

Your question doesn’t really show what solution you want.

Leave a comment