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

95
Views
cómo activar el evento de clic en la barra de búsqueda de autocompletar vue con el enlace del enrutador

Tengo una aplicación que es un clon de github. Quiero hacer que la barra de búsqueda funcione como github. Pero mi barra de búsqueda en la barra de navegación en la sección de opciones quiere hacer clic. He dado a la opción un evento pero sigue sin funcionar. aquí mi código

 data() { return { search: "", filteredrepo: [], owner: "dimaswntech", }; }, methods: { toRoute() { console.log("klilk", this.search); this.$router.push({ path: "/detail/" + this.search }); },
 <b-nav-form> <input class="form-control input-repo" type="text" v-model="search" @input="searchData" autocomplete="off" list="my-list-id" placeholder="Search repo" /> <datalist id="my-list-id" v-if="filteredrepo" @change="toRoute"> <option v-for="filterre in filteredrepo" :key="filterre.id"> {{ filterre.name }} </option> </datalist> <!-- <b-button size="sm" class="my-2 my-sm-0" type="submit" >Search</b-button > --> </b-nav-form>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

v-model es el método de enlace bidireccional de vue. Es igual a v-bind:value combinado con @input . Quitaría el @input

 <input :value="text" @input="event => text = event.target.value">
 <input v-model="text">

Luego, los datos de búsqueda deben incluir el valor de su barra de búsqueda y luego debe activar el método toRoute .

about 4 years ago · Juan Pablo Isaza 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!