Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

203
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda