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

176
Views
Selección desplegable para hacer coincidir un elemento en la matriz VueJS, JS

Estoy tratando de obtener una coincidencia exacta para mis selecciones desplegables. Entonces, en este ejemplo, si selecciono 'manzana', la consulta se ejecuta correctamente, pero también devuelve resultados para 'piña'. ¿Cómo obtengo solo una coincidencia exacta?

Tengo otra función en mi aplicación que devuelve los datos de uniqfruit.

el menú desplegable

 <select id="fruitselect" v-model="fruit" class="form-control" @change="fruitonChange($event)" :disabled="selectDisabledfruit" > <option disabled value="">Select fruit</option> <option v-for="fruit in uniqfruit" :key="fruit" :value="fruit"> {{ fruit }} </option> </select>

La función VueJS

 fruitonChange: function (e) { var id = e.target.value; var fruit = e.target.options[e.target.options.selectedIndex].text; if (id === uniqfruit) { this.runquery(); } else { e = "!showall"; } console.log("id ", id); console.log("fruit ", this.fruit); console.log("uniqfruit ", this.uniquefruit); },

Resultados de la consola

 id apple fruit apple uniqfruit Proxy {0: 'apple', 1: 'banana', 2: 'pineapple', 3: 'kiwi'}
about 4 years ago · Santiago Trujillo
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!