[Vuejs]-Vue.js: rendering data based on class

0👍

If you want to keep your UX data driven (which is the main point of using a framework like Vue), you have two main options:

  1. Change your data to include a “hidden” field on each user, use that field in a v-if or v-show, and have removeplayer() toggle it.

  2. Change removeplayer() to remove the player data structure from the players array.

I usually go the route of 2. and keep two lists of the players – one as it came from the server and the second starts off as a copy of that list and gets modified by the user via Vue (e.g. by removeplayer()).

Leave a comment