0

I have a problem updating the options array in a select tag in a VueJS component.

I have several rows and on select on each row. Each select will use the same options array. When one option is selected, that option should disappear from the others select.

I have try several ways to do that, but i'm not able to update the other options array (Using the Vue.set(...) function and all the caveats available).

The question in similar to this one but: - selector's array has to be dynamic - Options are the same for each selector

That's why the solution on that question doesn't work for me.

Community
  • 1
  • 1
Dakoso
  • 1
  • 1

1 Answers1

0

I should suggest you keep an array of usable options, and each time a value is selected, you splice the value from the usable options. When you v-for to create the list of options, you'll show only the ones that weren't selected yet.

Alex M.
  • 635
  • 1
  • 6
  • 19