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

84
Views
Select value from dropdown list according to response getting from backend

I have to show different dropdowns and in those dropdowns, I have to display dynamic values according to the id coming from the backend response. I have to show that id's value in that dropdown as selected and I have to give the feature of choosing a different value from the same dropdown and then sending it to the backend.

HTML code:

<div class="col-md-3">
   <label>Status: </label>
   <b-input-group left="<i class='fa fa-location-arrow'></i>">
    <select v-model = "Status">
     <option selected>{{cityState.status}}</option>
     <option v-for="item in StatusArray" :value="item">{{item.text}}</option>
    </select>
    </b-input-group>
</div>

Right now I am fetching the value directly from the backend response. But I have to show the value according to the id.

JS code :

export default {
  data(){
      return{
             cityState: { city: '', state: '', status: '',category: '' }

           }
        }
  methods:{
         //After API call :
         this.cityState.status = res.data.data.pincodestatus

}
}

Response from backend:

"data": {
        "pincodestatus": "Active",
         }

Array from which I have to fetch value and show its text:

StatusArray: [
        { value: "Active", text: "Active" },
        { value: "Embargo", text: "Embargo"},
        { value: "De-Active", text: "De-Active" },
        { value: "Essentials_Only", text: "Essentials Only" }
      ],
about 4 years ago · Juan Pablo Isaza
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!