I´m trying to fill my component vue-search-select with axios get and my laravel API. I´m receiving my data ok, but i can´t fill my select. In console i can show this:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')
But in my component i have all my data:
Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core
at <ModelListSelect options= (602) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …] option-value="code" option-text="name" ... >
i don´t understand very well that i´m doing wrong.
i´m working with vue js 3 and composition API.
my code it´s:
<script setup>
import { ref } from 'vue';
import { ModelSelect } from 'vue-search-select'
import { ModelListSelect } from 'vue-search-select'
import "vue-search-select/dist/VueSearchSelect.css"
const getAllItems = ref([])
const item = {
code: '',
name: ''
}
const allItems = () => {
axios.get('/api/getAllItems').then((response) => {
getAllItems.value = response.data.data;
});
}
allItems();
and my component call it:
<model-list-select :options="getAllItems"
option-value="code"
option-text="name"
v-model="item"
placeholder="Seleccionar más articulos">
</model-list-select>
I´m trying to fill my select with seeker i can show all my data in my console.log() but i have error that i don´t understand