[Vuejs]-V-select2 can not append value after load by $http

0👍

The objects you are returning from your API do not have a label property. You can customize the label used by v-select by adding it as a property.

<v-select multiple
  :debounce="250"
  :on-search="getOptions"
  :options="options"
  placeholder="Search Tag..."
  label="name">
</v-select>

Here is a working example.

0👍

Since you are returning an object array, define a ‘label’ designation to your component definition.

From the docs:

/**
   * An array of strings or objects to be used as dropdown choices.
   * If you are using an array of objects, vue-select will look for
   * a `label` key (ex. [{label: 'This is Foo', value: 'foo'}]). A
   * custom label key can be set with the `label` prop.
   * @type {Array}
   */
  options: {
    type: Array,
    default() { return [] },
  },

Leave a comment