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

119
Visualizações
check if input/value in b-form-selected

I have a b-form-select and when I choose one option I want to enable my button. But I don't know how to check if there is a value in my selection.

Thanks for helping me out !

<b-form-select v-model="data.Name" :value="data.Name"></b-form-select>

<b-button :disabled="!validDataAdded"></b-button>
computed: {
  validDataAdded: function(){
    return //Check here
  },
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In order to answer that question first we need to make some things clear.
v-model uses the :value attribute under the hood as a way to communicate with the component and pass down values.
That been said you dont need to add a :value attribute to your select component. If you need to set a initial value you simply need to set an initial value to your v-model.

If you want to check if there is a value to your selection you just need to check if the v-model has a value. Remember that a v-model corresponds to a property (either part of data or computed section).

In you example you need to check if data.Name contains a value or not.
Check out this sandbox where I create an example for you according you code-snippet.

Last but not least the way that you have written your v-model it seems that you have an object called data inside your data property

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