[Vuejs]-Vuejs DOM Not Updating

2πŸ‘

βœ…

The issue is the li is always running its click event handler even when you click on a button so selected will always be reassigned to the current product.

To fix it, do one of the fllowing:

  • Replace @click with @click.stop on each of the buttons to prevent the event from propagating up to the li.

  • remove the @click="selected = p" from the li and add it to the first span. This way the handler will only be run when the form is not present.

πŸ‘€David Weldon

Leave a comment