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:
-
Change your data to include a “hidden” field on each user, use that field in a
v-if
orv-show
, and haveremoveplayer()
toggle it. -
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()
).
Source:stackexchange.com