1

So I basically have multiple v-select that all share the same :items prop. Now if an item is selected from one of the v-select, I want to hide it from all v-select so we can't choose it again. Inverse logic when the item is free again.

Is that possible?

<div v-for="(filter, index) in group.filterMeta" :key="index">
    <v-select
      v-model="filter.tag"
      :items="availableTags"
      :label="i18n('select.tag.label')"
    >
    </v-select>
</div>
@Component
export default class ManageGroupDialog extends Vue {
    ...
    /** Available tags */
    public availableTags = ['resource', 'resource_type', 'host', 'technology']
    ...
    public group: Group = {
        ...
        filterMeta: [
            {
                 tag: '',
                 value: '',
                 operator: ''
            }
        ]
        ...
    }
}

1 Answers1

0

If you're working with multiple components looks like you need to start using Vuex. This way you can have a global state, and use the same items array in all your v-selects over your components.

cmfc31
  • 1,385
  • 2
  • 8
  • 9