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

202
Visualizações
Vue3 default value in select options

how would I add a default value to this template. the default value would be the first option in the list which is 'Please Select...'

  <template #dropDownSelection="{ props }">
    <td colspan="1">
      <select
        id="IvrElementId"
        v-model="props.dataItem[props.field]"
        @change="inputChanged(props)"
      >
        <option
          v-for="option in findFilterOptions(props.field)"
          :key="option.Value"
          :value="option.Value"
        >
          {{ option.Text }}
        </option>
      </select>
    </td>
  </template>

this is the response.data

0: {Text: 'Please Select...', Value: '0', Description: null, Selected: false, Active: false, …}
1: {Text: 'Hang Up Start (Default) (Default Page)', Value: '2', Description: null, Selected: false, Active: false, …}
2: {Text: 'Hold Start (Default) (Default Page)', Value: '1', Description: null, Selected: false, Active: false, …}
3: {Text: 'VQ Start (Virtual Queue Page)', Value: '6', Description: null, Selected: false, Active: false, …}
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Thanks for this, turns out I just needed to include this on my addRecord method...

    addRecord: function () {

        const dataItem = {
            inEdit: true,
            changed: true,
            Active: true,
            //0 = Please Select...
            CampaignId: 0,
            IvrId: 0,
            ListId: 0,
            TagIds: []
            
        };
over 4 years ago · Santiago Trujillo Relatório

0

What about

        <option
          v-for="option in findFilterOptions(props.field)"
          :key="option.Value"
          :value="option.Value"
          :selected="option.Value === '0' ? 'selected' : null"
        >
          {{ option.Text }}
        </option>

You could also set the selected attr in option 0 to true and use that one instead of option.Value

over 4 years ago · Santiago Trujillo 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