A
A
Anna Kolchina2021-10-19 20:38:31
Vue.js
Anna Kolchina, 2021-10-19 20:38:31

Why is vue-select not working?

When trying to add vue-select to the project, an error appears TypeError: this.$on is not a function:

616f024645534269832886.png

I did everything according to the documentation .

<template>
  <div>
    <v-select :options="options" label="country" :reduce="country => country.code" />
  </div>
</template>

import vSelect from 'vue-select'

export default {
  data() {
    return {
      options: [{country: 'Canada', code: 'CA'},],
    }
  },
  components: {
    vSelect
  },
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-10-19
@hacborn

What is the vue version? 3? - the error you showed can be obtained by trying to use vue-select inside a vue3 app. Support for vue3 is not yet available, but they promise that it will appear soon .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question