Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!