Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

62
Visualizações
vue-select library set default value not working properly

This is the library that I'm using.

vue-select

And I have this kind of data

[
    { text: "AAA", value: 1 },
    { text: "BBB", value: 2 },
]
<v-select
    id="modal-job_type"
    :value="1" // v-model also doesnt work for me
    item-value="value"
    name="job_type"
    :options="jobTypeOptions"
    label="text"
/>

I expect to see "AAA" selected.

But instead I see "1" text.

What is wrong?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I guess you need to set a value of options to v-model, instead of the index. (Though, I couldn't find a page where it is clearly stated in the official document.)

It would look like;

const options = [
    { text: "AAA", value: 1 },
    { text: "BBB", value: 2 },
]
const selected = ref(options[1]) // Setting initial value
<v-select
    v-model="selected"
    label="text"
/>

Also, Vue Select does not have item-value property. It seems you are confused with Vuetify's v-select. https://vuetifyjs.com/en/api/v-select/#props-item-value

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda