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

334
Views
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
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!