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

345
Vistas
Vue 3 - need help to highlight text from input

I'm working on a small project which gets data from a json file and displays it in table format. Made search feature which is working fine, but I'd also like if the inputted letter/word will be highlighted(like user typing something into search input and that typed thing is being styled differently so it stands out in the result of the search). Can't figure out how to implement this, any help would be appreciated. I've really stuck on this one.

<tr v-for="teacher in mySearchFunc" :key="teacher.id">
  <td><router-link :to="{ name: 'Home'}">{{teacher.name}} </router-link></td>
  <td>{{teacher.birthday}}.{{teacher.birthmonth}}.{{teacher.birthyear}}</td>
  <td>{{teacher.phoneNum}}</td>
  <td>{{teacher.type}}</td>
  <td>{{teacher.id}}</td>
  <td><router-link to="#" class="subjectsBtn">Subjects</router-link></td>
  <td><button class="edit_btn"><span class="material-icons">edit</span></button></td>
  <td><button class="delete_btn"><span class="material-icons">delete</span></button></td>
</tr>

export default {
  data() {
    return {
      teachers: [],
      search: ''
    }
  }, 
  computed: {
    mySearchFunc() {
      return this.teachers.filter(teacher => 
       teacher.name.toLowerCase().includes(this.search.toLowerCase()))
    }
  }
}
about 4 years ago · Juan Pablo Isaza
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